0

How to match any character up to the first occurrence of a pattern in a PCRE regex?

The following regex where I'm trying to turn on the non-greedy mode by adding a question mark after the +:

.+?(?=non)

applied to "Proin non urna non diam feugiat semper" matches "Proin non urna " instead of the desired output: "Proin ".

Thanks.

Joe Catin
  • 33
  • 3

0 Answers0