perl - all possible sub strings matching the regex -


i have string

<start><tag1><tag2><tag3><end> 

if have regex <.*end> matches complete string , stops. there way gives matching substrings ike

<end> <tag3><end> <tag2><tag3><end> <tag1><tag2><tag3><end> 

yes, must wrap pattern in lookahead (this way obtain overlapped results):

(?=(<.*end>)) 

the result in capture group 1.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -