Let\'s say I have the following string:
this is a test for the sake of testing. this is only a test. The end.
and I want to se
The regex is greedy meaning it will capture as many characters as it can which fall into the .* match. To make it non-greedy try:
.*
this(.*?)test
The ? modifier will make it capture as few characters as possible in the match.
?