[pcre-dev] matching problem w default newline of anycrlf

Góra strony
Delete this message
Autor: Sheri
Data:  
Dla: pcre-dev
Temat: [pcre-dev] matching problem w default newline of anycrlf
pcre default newline is anycrlf

This matches:

re> /(\n|\r)/
data> \r\na

0: \x0d
1: \x0d

and this matches:

re> /\n/
data> \r\na

0: \x0a

but this fails:

re> /(\n|\r)a/
data> \r\na

No match

Matches same data with either of these:

re> /(\n|\r)a/<lf>
re> /(\n|\r)a/<cr>


fails with any of these:

re> /(\n|\r)a/<crlf>
re> /(\n|\r)a/<any>
re> /(\n|\r)a/<anycrlf>


I expected only the behavior of a few metacharacters to be affected by
the newline in effect. In our application update project we added new
functions that allow the user to specify external options, but we also
maintained the existing posix based functions which allow for only
internal options. Since the libary default is the only choice for posix,
and (as part of our application update) we changed from LF to ANYCRLF as
default, we are now hearing about user conversion difficulties.

Regards,
Sheri