Page 1 of 1

Pattern Matching Reference - PCRE REGULAR EXPRESSION DETAILS

Posted: Wed May 16, 2012 7:43 am
by dfhtextpipe
This issue has been a stumbling block more times than I can remember, but I always forget.
Happened again today, and it took me ages before I realized why.
^ assert start of string (or line, in multiline mode)
$ assert end of string (or line, in multiline mode)
The issue is this:

When the EOLs are Unix/Amiga style, the ^ doesn't work. It works fine when the EOLs are DOS/Windows.
Not tried it for Mac style EOLs.

David

Re: Pattern Matching Reference - PCRE REGULAR EXPRESSION DET

Posted: Wed May 16, 2012 4:59 pm
by DataMystic Support
I found the same thing, although I thought this was addressed in the past.

The perl regex position '^' for the start of the file now works with Unix files.

Re: Pattern Matching Reference - PCRE REGULAR EXPRESSION DET

Posted: Wed May 16, 2012 8:26 pm
by dfhtextpipe
Thanks Simon,

How did the bug manage to creep back? Was there a revert in the version control system?

I didn't check whether there was a similar issue with '$' for assert end of string. Did you?

Neither did I check whether the issue also affected Mac EOLs.

David

Re: Pattern Matching Reference - PCRE REGULAR EXPRESSION DET

Posted: Wed May 16, 2012 11:32 pm
by DataMystic Support
I think it was more that a change in the underlying pcre engine allowed it to creep in, and yes, it probably does affect Mac EOL's with '$'.

Methinks a new release will be out shortly.