regex to extract a portion of a string -


i looking regular expression search portion of string , extract subsequent parameter...

source strings here:

 5288470f7e7155f1a19d7236f837d3cc:120// 5288470f7e7155f1a19d7236f837d3dd:20// 5288470f7e7155f1a19d72daff:9302// 

the source string length , follow same pattern: id:result//

i need able search string longer id , extract subsequent number between : , // pattern. give search string "5288470f7e7155f1a19d7236f837d3dd" - need result "20"

can help?

thanks

using grep can in following way:

grep -po "(?<=$target_string:)\d+(?=\/\/)" 

this print number require. regex used perl compatible.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -