Using regex to find any last occurrence of a word between two delimiters -


suppose have following test string:

start_get_get_get_stop_start_get_get_stop_start_get_stop

where _ means characters, eg: startagetbbgetcccgetddddstopeeeeestart....

what want extract last occurrence of word within start , stop delimiters. result here 3 bolded below.

start__get__get__get__stop__start__get__get__stop__start__get__stop

i precise i'd using regex , far possible in single pass.

any suggestions welcome

thanks'

get(?=(?:(?!get|start|stop).)*stop) 

i'm assuming start , stop delimiters balanced , can't nested.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -