Regular expression to stop at first match
You need to make your regular expression lazy/non-greedy, because by default, “(.*)” will match all of “file path/level1/level2″ xxx some=”xxx”. Instead you can make your dot-star non-greedy, which will make it match as few characters as possible: Adding a ? on a quantifier (?, * or +) makes it non-greedy. Note: this is only available … Read more