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
Post a Comment