How do I extract the string in between but not consuming the characters,
The string:
abc123
def456
ghi789
I was using the regex below and it returns the string in between 123 and 789:
/123(.*?)789/s
What I want to extract is:
123
def456
ghi789
How do I extract the string in between but not consuming the characters,
The string:
abc123
def456
ghi789
I was using the regex below and it returns the string in between 123 and 789:
/123(.*?)789/s
What I want to extract is:
123
def456
ghi789
The capturing parens should be placed around what you want to capture, so replace
/123(.*?)789/s
with
/(123.*?789)/s
Now, 123 and 789 will be included in the captured text as requested.