Pattern Matching Reference - PCRE REGULAR EXPRESSION DETAILS

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
dfhtextpipe
Posts: 986
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Pattern Matching Reference - PCRE REGULAR EXPRESSION DETAILS

Post 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
David
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Pattern Matching Reference - PCRE REGULAR EXPRESSION DET

Post 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.
dfhtextpipe
Posts: 986
Joined: Sun Dec 09, 2007 2:49 am
Location: UK

Re: Pattern Matching Reference - PCRE REGULAR EXPRESSION DET

Post 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
David
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Pattern Matching Reference - PCRE REGULAR EXPRESSION DET

Post 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.
Post Reply