Good day,
I need to extract portion of string which can looks like this:
"some_text MarkerA some_text_to_extract MarkerB some_text"
"some_text MarkerA some_text_to_extract"
I need to extract some_text_to_extract
in both cases.
MarkerA
, MarkerB
- predefined text strings.
I tried this regexps, but with no luck:
".*\sMarkerA(.*)MarkerB.*" - does not work in case 2
".*\sMarkerA(.*)(?=MarkerB)?.*" - wrong result "some_text_to_extract MarkerB some_text"
".*\sMarkerA(.*)(?:MarkerB)?.*" - does not work at all
Could you please help me with this issue?