Loading ...
Sorry, an error occurred while loading the content.

Re: RegEx Bug (Addendum)

Expand Messages
  • flo.gehrke
    ... 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
    Message 1 of 2 , Oct 27, 2012
    • 0 Attachment
      --- In ntb-clips@yahoogroups.com, Art Kocsis <artkns@...> wrote:
      >
      > 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

      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'.

      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':

      xxx


      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.

      Regards,
      Flo
    Your message has been successfully submitted and would be delivered to recipients shortly.