Re: RegEx Bug (Addendum)
- --- In firstname.lastname@example.org, Art Kocsis <artkns@...> wrote:
>During betatest of NT 7.0, we discussed an issue where a pattern like '\w+\R\s*\R\w+' didn't work any more whereas it worked when '\R' was replaced with '\r\n'.
> Addendum: Replacing the "\R" with "\r\n" in the search
> pattern "fixes" the problem.
> \R(^\h*?\R)+ Fails
> \r\n(^\h*?\r\n)+ Works
> Namaste', Art
This problem was resolved with an update of DIRegEx, the embedding of PCRE into NT. In this context, the developer spoke of "\s*\R auto-possessifying the \s* when it should not".
We probably have got a similar issue here. (I can't reproduce it since I have installed NT 7.1 only.)
With v7.1, NT was updated to the latest version of DIRegEx. So, with NT 7.1, a pattern like that causes no problem any more.
Example: There are two lines containing three spaces between 'xxx' and 'yyy':
With v7.1, the pattern '(^\h+\R)+' matches line #2 and #3 without any problem.
If 'yyy' is missing, and line #3 is at end of string, use '(^\h+(\R|\Z))+' in order to match line #2 and #3.