--- In [email protected], "entropyreduction"
<alancampbelllists+ya...@...> wrote:
>
> --- In [email protected], "Sheri" <sherip99@> wrote:
> 
> > I certainly don't mind updating the docs, but I'd like to check
> > and see if I can identify a few other regex plugin issues for an
> > update. For example PCRE has added a few options. Also a few
> > settings not currently supported by regex.getPcreProperty. And
> > I've had some unexpected results where backslash was mishandled
> > when using the "literal" option (but I need to see if I can
> > locate them). 
> 
> I sort of suspected new features (and bugs) might be accumulating.
> 
> I found bug re variables: over-enthusiastic attempt to allow a var
> name to occur anywhere (like a vec handle).  Fix is easy.
>

The problem with "literal" option should have shown up in
regexPluginTest 43c, but the intending replacement string and option
were not defined prior to or applied to the test. The literal option
is supposed to bypass all evaluation and substitution applied to the
replacement string.

Examples:

win.debug(?"Expected: \x22This subject had quotations.\x22")
win.debug("Actual:", regex.pcrereplace(?X"X, ;;+
?X"This subject has quotations."X, ?"\x22", "literal"))
;The quotations should be literally replaced by backslash x 2 2.
win.debug("")
local notefolder = pprofolder++?"notes"
win.debug("Expected: Notes folder: "++pprofolder++?"Notes")
win.debug("Actual: ",regex.pcrereplace(?": \K", ?"Notes folder: ", ;;+
notefolder, "literal"))
;there s/b no control characters or missing backslashes

here are the newer defines in pcre.h
#define PCRE_BSR_ANYCRLF        0x00800000
#define PCRE_BSR_UNICODE        0x01000000
#define PCRE_JAVASCRIPT_COMPAT  0x02000000
#define PCRE_CONFIG_BSR                     8

newish Compile-Time options
PCRE_JAVASCRIPT_COMPAT
PCRE_BSR_ANYCRLF
PCRE_BSR_UNICODE

newish Exec-Time options
PCRE_BSR_ANYCRLF
PCRE_BSR_UNICODE

newish property of the pcre library:
PCRE_CONFIG_BSR
if zero, means backslash-R normally matches all Unicode line endings
if one, means backslash-R normally matches CR, LF, or CRLF only

Regards,
Sheri

Reply via email to