POSIX elements of PCRE
Posted: Wed Jun 08, 2016 1:49 am
Hello
I have been finding some strange faults in the implementation of the POSIX bits of PCRE regular expressions when doing Find Replace in Files applied to a set of 58 files.
The files contain refereneces to St.Paul, St. Peter, St. Anne, St. Aubyn, and St, George
(one space character, no trailing , of course)
with case sensitive and regex checked and no POSIX I find (correctly):
search for St. Paul found 8 occurrences (correct)
St. Peter 3
St. P 11
St. Anne 1
St. Aubyn 2
St. A 3
St. George 7
St. G 7
BUT if I use for example the Posix standard [[:upper:]] as implemented in standard PCRE
with 'case sensitive' and regex (both boxes checked)
St. ([[:upper:]]) finds nothing
st. ([[:upper:]]) finds nothing
with 'NOT case sensitive' and regex (only the regex box checked)
St. ([[:upper:]]) finds 11 (all Peter and Paul, but NO Anne, Aubyn or George)
st. ([[:upper:]]) finds 11 (all Peter and Paul, but NO Anne, Aubyn or George)
I was under the impression you implemented PCRE including POSIX bits, but the POSIX bits don't seem to work very well.
Time to upgrade to full PCRE?
Ron
I have been finding some strange faults in the implementation of the POSIX bits of PCRE regular expressions when doing Find Replace in Files applied to a set of 58 files.
The files contain refereneces to St.Paul, St. Peter, St. Anne, St. Aubyn, and St, George
(one space character, no trailing , of course)
with case sensitive and regex checked and no POSIX I find (correctly):
search for St. Paul found 8 occurrences (correct)
St. Peter 3
St. P 11
St. Anne 1
St. Aubyn 2
St. A 3
St. George 7
St. G 7
BUT if I use for example the Posix standard [[:upper:]] as implemented in standard PCRE
with 'case sensitive' and regex (both boxes checked)
St. ([[:upper:]]) finds nothing
st. ([[:upper:]]) finds nothing
with 'NOT case sensitive' and regex (only the regex box checked)
St. ([[:upper:]]) finds 11 (all Peter and Paul, but NO Anne, Aubyn or George)
st. ([[:upper:]]) finds 11 (all Peter and Paul, but NO Anne, Aubyn or George)
I was under the impression you implemented PCRE including POSIX bits, but the POSIX bits don't seem to work very well.
Time to upgrade to full PCRE?
Ron