The following regex works when I test it here: https://regex101.com/r/oxsNRW/2
(toString\(\)[\s\S]+\))(\s*\R\s*?})
However, when I put the same input and regex into Notepad++ on Windows 10 it says the regex is invalid. Why?
The following regex works when I test it here: https://regex101.com/r/oxsNRW/2
(toString\(\)[\s\S]+\))(\s*\R\s*?})
However, when I put the same input and regex into Notepad++ on Windows 10 it says the regex is invalid. Why?
Notepad++ regex flavor is Boost, and its regex syntax is a bit different from PCRE.
In your case, escape the }
:
(toString\(\)[\s\S]+\))(\s*\R\s*\}) ^^