Revision: 88
http://www.exim.org/viewvc/pcre2?view=rev&revision=88
Author: ph10
Date: 2014-10-01 18:02:33 +0100 (Wed, 01 Oct 2014)
Log Message:
-----------
Remove the ability to change newlines and \R at match time.
Modified Paths:
--------------
code/trunk/doc/pcre2api.3
code/trunk/doc/pcre2test.1
code/trunk/src/pcre2.h.in
code/trunk/src/pcre2_context.c
code/trunk/src/pcre2_dfa_match.c
code/trunk/src/pcre2_intmodedep.h
code/trunk/src/pcre2_match.c
code/trunk/src/pcre2grep.c
code/trunk/src/pcre2test.c
code/trunk/testdata/testinput2
code/trunk/testdata/testinput5
code/trunk/testdata/testinput6
code/trunk/testdata/testinput7
code/trunk/testdata/testoutput2
code/trunk/testdata/testoutput5
code/trunk/testdata/testoutput6
code/trunk/testdata/testoutput7
Modified: code/trunk/doc/pcre2api.3
===================================================================
--- code/trunk/doc/pcre2api.3 2014-10-01 16:16:27 UTC (rev 87)
+++ code/trunk/doc/pcre2api.3 2014-10-01 17:02:33 UTC (rev 88)
@@ -1,4 +1,4 @@
-.TH PCRE2API 3 "16 September 2014" "PCRE2 10.00"
+.TH PCRE2API 3 "01 October 2014" "PCRE2 10.00"
.SH NAME
PCRE2 - Perl-compatible regular expressions (revised API)
.sp
@@ -88,13 +88,13 @@
.sp
.B void pcre2_compile_context_free(pcre2_compile_context *\fIccontext\fP);
.sp
-.B int pcre2_set_bsr_compile(pcre2_compile_context *\fIccontext\fP,
+.B int pcre2_set_bsr(pcre2_compile_context *\fIccontext\fP,
.B " uint32_t \fIvalue\fP);"
.sp
.B int pcre2_set_character_tables(pcre2_compile_context *\fIccontext\fP,
.B " const unsigned char *\fItables\fP);"
.sp
-.B int pcre2_set_newline_compile(pcre2_compile_context *\fIccontext\fP,
+.B int pcre2_set_newline(pcre2_compile_context *\fIccontext\fP,
.B " uint32_t \fIvalue\fP);"
.sp
.B int pcre2_set_parens_nest_limit(pcre2_compile_context *\fIccontext\fP,
@@ -117,9 +117,6 @@
.sp
.B void pcre2_match_context_free(pcre2_match_context *\fImcontext\fP);
.sp
-.B int pcre2_set_bsr_match(pcre2_match_context *\fImcontext\fP,
-.B " uint32_t \fIvalue\fP);"
-.sp
.B int pcre2_set_callout(pcre2_match_context *\fImcontext\fP,
.B " int (*\fIcallout_function\fP)(pcre2_callout_block *),"
.B " void *\fIcallout_data\fP);"
@@ -127,9 +124,6 @@
.B int pcre2_set_match_limit(pcre2_match_context *\fImcontext\fP,
.B " uint32_t \fIvalue\fP);"
.sp
-.B int pcre2_set_newline_match(pcre2_match_context *\fImcontext\fP,
-.B " uint32_t \fIvalue\fP);"
-.sp
.B int pcre2_set_recursion_limit(pcre2_match_context *\fImcontext\fP,
.B " uint32_t \fIvalue\fP);"
.sp
@@ -549,7 +543,7 @@
PCRE2_ERROR_BADDATA if invalid data is detected.
.sp
.nf
-.B int pcre2_set_bsr_compile(pcre2_compile_context *\fIccontext\fP,
+.B int pcre2_set_bsr(pcre2_compile_context *\fIccontext\fP,
.B " uint32_t \fIvalue\fP);"
.fi
.sp
@@ -558,8 +552,7 @@
ending sequence. The value of this parameter does not affect what is compiled;
it is just saved with the compiled pattern. The value is used by the JIT
compiler and by the two interpreted matching functions, \fIpcre2_match()\fP and
-\fIpcre2_dfa_match()\fP. You can change the value when calling these functions,
-but doing so disables the use of JIT.
+\fIpcre2_dfa_match()\fP.
.sp
.nf
.B int pcre2_set_character_tables(pcre2_compile_context *\fIccontext\fP,
@@ -571,7 +564,7 @@
in the current locale.
.sp
.nf
-.B int pcre2_set_newline_compile(pcre2_compile_context *\fIccontext\fP,
+.B int pcre2_set_newline(pcre2_compile_context *\fIccontext\fP,
.B " uint32_t \fIvalue\fP);"
.fi
.sp
@@ -585,8 +578,7 @@
parameter affects the recognition of white space and the end of internal
comments starting with #. The value is saved with the compiled pattern for
subsequent use by the JIT compiler and by the two interpreted matching
-functions, \fIpcre2_match()\fP and \fIpcre2_dfa_match()\fP. You can change the
-value when calling these functions, but doing so disables the use of JIT.
+functions, \fIpcre2_match()\fP and \fIpcre2_dfa_match()\fP.
.sp
.nf
.B int pcre2_set_parens_nest_limit(pcre2_compile_context *\fIccontext\fP,
@@ -647,16 +639,6 @@
PCRE2_ERROR_BADDATA if invalid data is detected.
.sp
.nf
-.B int pcre2_set_bsr_match(pcre2_match_context *\fImcontext\fP,
-.B " uint32_t \fIvalue\fP);"
-.fi
-.sp
-The value must be PCRE2_BSR_ANYCRLF, to specify that \eR matches only CR, LF,
-or CRLF, or PCRE2_BSR_UNICODE, to specify that \eR matches any Unicode line
-ending sequence. If you want to make use of JIT matching, you should not use
-this function, but instead set the value in a compile context.
-.sp
-.nf
.B int pcre2_set_callout(pcre2_match_context *\fImcontext\fP,
.B " int (*\fIcallout_function\fP)(pcre2_callout_block *),"
.B " void *\fIcallout_data\fP);"
@@ -736,19 +718,6 @@
limit is set, less than the default.
.sp
.nf
-.B int pcre2_set_newline_match(pcre2_match_context *\fImcontext\fP,
-.B " uint32_t \fIvalue\fP);"
-.fi
-.sp
-This specifies which characters or character sequences are to be recognized as
-newlines. The value must be one of PCRE2_NEWLINE_CR (carriage return only),
-PCRE2_NEWLINE_LF (linefeed only), PCRE2_NEWLINE_CRLF (the two-character
-sequence CR followed by LF), PCRE2_NEWLINE_ANYCRLF (any of the above), or
-PCRE2_NEWLINE_ANY (any Unicode newline sequence). If you want to make use of
-JIT matching, you should not use this function, but instead set the value in a
-compile context.
-.sp
-.nf
.B int pcre2_set_recursion_memory_management(
.B " pcre2_match_context *\fImcontext\fP,"
.B " void *(*\fIprivate_malloc\fP)(PCRE2_SIZE, void *),"
@@ -2683,6 +2652,6 @@
.rs
.sp
.nf
-Last updated: 16 September 2014
+Last updated: 01 October 2014
Copyright (c) 1997-2014 University of Cambridge.
.fi
Modified: code/trunk/doc/pcre2test.1
===================================================================
--- code/trunk/doc/pcre2test.1 2014-10-01 16:16:27 UTC (rev 87)
+++ code/trunk/doc/pcre2test.1 2014-10-01 17:02:33 UTC (rev 88)
@@ -458,9 +458,6 @@
The \fBnewline\fP modifier specifies which characters are to be interpreted as
newlines, both in the pattern and (by default) in subject lines. The type must
be one of CR, LF, CRLF, ANYCRLF, or ANY.
-.P
-Both the \eR and newline settings can be changed at match time, but if this is
-done, JIT matching is disabled.
.
.
.SS "Information about a pattern"
@@ -693,7 +690,6 @@
allcaptures show all captures
allusedtext show all consulted text
altglobal alternative global matching
- bsr=[anycrlf|unicode] specify \eR handling
callout_capture show captures at callout time
callout_data=<n> set a value to pass via callouts
callout_fail=<n>[:<m>] control callout failure
@@ -709,7 +705,6 @@
mark show mark values
match_limit=>n> set a match limit
memory show memory usage
- newline=<type> set newline type
offset=<n> set starting offset
ovector=<n> set size of output vector
recursion_limit=<n> set a recursion limit
@@ -718,14 +713,6 @@
FIXME: Give more examples.
.
.
-.SS "Newline and \eR handling"
-.rs
-.sp
-These modifiers set the newline and \eR processing conventions for the subject
-line, overriding any values that were set at compile time (as described above).
-JIT matching is disabled if these settings are changed at match time.
-.
-.
.SS "Showing more text"
.rs
.sp
Modified: code/trunk/src/pcre2.h.in
===================================================================
--- code/trunk/src/pcre2.h.in 2014-10-01 16:16:27 UTC (rev 87)
+++ code/trunk/src/pcre2.h.in 2014-10-01 17:02:33 UTC (rev 88)
@@ -140,9 +140,9 @@
#define PCRE2_DFA_RESTART 0x00000040u
#define PCRE2_DFA_SHORTEST 0x00000080u
-/* Newline and \R settings, for use in the compile and match contexts. The
-newline values must be kept in step with values set in config.h and both sets
-must all be greater than zero. */
+/* Newline and \R settings, for use in compile contexts. The newline values
+must be kept in step with values set in config.h and both sets must all be
+greater than zero. */
#define PCRE2_NEWLINE_CR 1
#define PCRE2_NEWLINE_LF 2
@@ -356,12 +356,10 @@
PCRE2_EXP_DECL \
pcre2_compile_context *pcre2_compile_context_create(pcre2_general_context *);\
PCRE2_EXP_DECL void pcre2_compile_context_free(pcre2_compile_context *); \
-PCRE2_EXP_DECL int pcre2_set_bsr_compile(pcre2_compile_context *, \
- uint32_t); \
+PCRE2_EXP_DECL int pcre2_set_bsr(pcre2_compile_context *, uint32_t); \
PCRE2_EXP_DECL int pcre2_set_character_tables(pcre2_compile_context *, \
const unsigned char *); \
-PCRE2_EXP_DECL int pcre2_set_newline_compile(pcre2_compile_context *, \
- uint32_t); \
+PCRE2_EXP_DECL int pcre2_set_newline(pcre2_compile_context *, uint32_t); \
PCRE2_EXP_DECL int pcre2_set_parens_nest_limit(pcre2_compile_context *, \
uint32_t); \
PCRE2_EXP_DECL int pcre2_set_compile_recursion_guard(\
@@ -373,14 +371,10 @@
PCRE2_EXP_DECL \
pcre2_match_context *pcre2_match_context_create(pcre2_general_context *); \
PCRE2_EXP_DECL void pcre2_match_context_free(pcre2_match_context *); \
-PCRE2_EXP_DECL int pcre2_set_bsr_match(pcre2_match_context *, \
- uint32_t); \
PCRE2_EXP_DECL int pcre2_set_callout(pcre2_match_context *, \
int (*)(pcre2_callout_block *), void *); \
PCRE2_EXP_DECL int pcre2_set_match_limit(pcre2_match_context *, \
uint32_t); \
-PCRE2_EXP_DECL int pcre2_set_newline_match(pcre2_match_context *, \
- uint32_t); \
PCRE2_EXP_DECL int pcre2_set_recursion_limit(pcre2_match_context *, \
uint32_t); \
PCRE2_EXP_DECL int pcre2_set_recursion_memory_management( \
@@ -552,14 +546,12 @@
#define pcre2_match_data_create_from_pattern PCRE2_SUFFIX(pcre2_match_data_create_from_pattern_)
#define pcre2_match_data_free PCRE2_SUFFIX(pcre2_match_data_free_)
#define pcre2_pattern_info PCRE2_SUFFIX(pcre2_pattern_info_)
-#define pcre2_set_bsr_compile PCRE2_SUFFIX(pcre2_set_bsr_compile_)
-#define pcre2_set_bsr_match PCRE2_SUFFIX(pcre2_set_bsr_match_)
+#define pcre2_set_bsr PCRE2_SUFFIX(pcre2_set_bsr_)
#define pcre2_set_callout PCRE2_SUFFIX(pcre2_set_callout_)
#define pcre2_set_character_tables PCRE2_SUFFIX(pcre2_set_character_tables_)
#define pcre2_set_compile_recursion_guard PCRE2_SUFFIX(pcre2_set_compile_recursion_guard_)
#define pcre2_set_match_limit PCRE2_SUFFIX(pcre2_set_match_limit_)
-#define pcre2_set_newline_compile PCRE2_SUFFIX(pcre2_set_newline_compile_)
-#define pcre2_set_newline_match PCRE2_SUFFIX(pcre2_set_newline_match_)
+#define pcre2_set_newline PCRE2_SUFFIX(pcre2_set_newline_)
#define pcre2_set_parens_nest_limit PCRE2_SUFFIX(pcre2_set_parens_nest_limit_)
#define pcre2_set_recursion_limit PCRE2_SUFFIX(pcre2_set_recursion_limit_)
#define pcre2_set_recursion_memory_management PCRE2_SUFFIX(pcre2_set_recursion_memory_management_)
Modified: code/trunk/src/pcre2_context.c
===================================================================
--- code/trunk/src/pcre2_context.c 2014-10-01 16:16:27 UTC (rev 87)
+++ code/trunk/src/pcre2_context.c 2014-10-01 17:02:33 UTC (rev 88)
@@ -169,8 +169,6 @@
#endif
mcontext->callout = NULL;
mcontext->callout_data = NULL;
-mcontext->newline_convention = 0;
-mcontext->bsr_convention = 0;
mcontext->match_limit = MATCH_LIMIT;
mcontext->recursion_limit = MATCH_LIMIT_RECURSION;
}
@@ -279,7 +277,7 @@
}
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
-pcre2_set_bsr_compile(pcre2_compile_context *ccontext, uint32_t value)
+pcre2_set_bsr(pcre2_compile_context *ccontext, uint32_t value)
{
switch(value)
{
@@ -294,7 +292,7 @@
}
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
-pcre2_set_newline_compile(pcre2_compile_context *ccontext, uint32_t newline)
+pcre2_set_newline(pcre2_compile_context *ccontext, uint32_t newline)
{
switch(newline)
{
@@ -330,39 +328,6 @@
/* ------------ Match contexts ------------ */
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
-pcre2_set_bsr_match(pcre2_match_context *mcontext, uint32_t value)
-{
-switch(value)
- {
- case PCRE2_BSR_ANYCRLF:
- case PCRE2_BSR_UNICODE:
- mcontext->bsr_convention = value;
- return 0;
-
- default:
- return PCRE2_ERROR_BADDATA;
- }
-}
-
-PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
-pcre2_set_newline_match(pcre2_match_context *mcontext, uint32_t newline)
-{
-switch(newline)
- {
- case PCRE2_NEWLINE_CR:
- case PCRE2_NEWLINE_LF:
- case PCRE2_NEWLINE_CRLF:
- case PCRE2_NEWLINE_ANY:
- case PCRE2_NEWLINE_ANYCRLF:
- mcontext->newline_convention = newline;
- return 0;
-
- default:
- return PCRE2_ERROR_BADDATA;
- }
-}
-
-PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
pcre2_set_callout(pcre2_match_context *mcontext,
int (*callout)(pcre2_callout_block *), void *callout_data)
{
Modified: code/trunk/src/pcre2_dfa_match.c
===================================================================
--- code/trunk/src/pcre2_dfa_match.c 2014-10-01 16:16:27 UTC (rev 87)
+++ code/trunk/src/pcre2_dfa_match.c 2014-10-01 17:02:33 UTC (rev 88)
@@ -3069,7 +3069,6 @@
{
const pcre2_real_code *re = (const pcre2_real_code *)code;
pcre2_match_context default_context; /* For use if no context given */
-int newline;
PCRE2_SPTR start_match;
PCRE2_SPTR end_subject;
@@ -3203,18 +3202,11 @@
mb->moptions = options;
mb->poptions = re->overall_options;
-/* The match context /R convention, if set, overrides. */
+/* Process the \R and newline settings. */
-mb->bsr_convention = (mcontext->bsr_convention != 0)?
- mcontext->bsr_convention : re->bsr_convention;
-
-/* Process the newline setting. */
-
-newline = (mcontext->newline_convention == 0)?
- re->newline_convention : mcontext->newline_convention;
-
+mb->bsr_convention = re->bsr_convention;
mb->nltype = NLTYPE_FIXED;
-switch(newline)
+switch(re->newline_convention)
{
case PCRE2_NEWLINE_CR:
mb->nllen = 1;
Modified: code/trunk/src/pcre2_intmodedep.h
===================================================================
--- code/trunk/src/pcre2_intmodedep.h 2014-10-01 16:16:27 UTC (rev 87)
+++ code/trunk/src/pcre2_intmodedep.h 2014-10-01 17:02:33 UTC (rev 88)
@@ -570,8 +570,6 @@
#endif
int (*callout)(pcre2_callout_block *);
void *callout_data;
- uint16_t bsr_convention;
- uint16_t newline_convention;
uint32_t match_limit;
uint32_t recursion_limit;
} pcre2_real_match_context;
Modified: code/trunk/src/pcre2_match.c
===================================================================
--- code/trunk/src/pcre2_match.c 2014-10-01 16:16:27 UTC (rev 87)
+++ code/trunk/src/pcre2_match.c 2014-10-01 17:02:33 UTC (rev 88)
@@ -6346,7 +6346,6 @@
pcre2_match_context *mcontext)
{
int rc;
-int newline;
int ocount;
const uint8_t *start_bits = NULL;
@@ -6482,8 +6481,7 @@
selected normal or partial matching mode was not compiled). */
#ifdef SUPPORT_JIT
-if (re->executable_jit != NULL && (options & ~PUBLIC_JIT_MATCH_OPTIONS) == 0 &&
- mcontext->bsr_convention == 0 && mcontext->newline_convention == 0)
+if (re->executable_jit != NULL && (options & ~PUBLIC_JIT_MATCH_OPTIONS) == 0)
{
rc = pcre2_jit_match(code, subject, length, start_offset, options,
match_data, mcontext, NULL);
@@ -6553,18 +6551,11 @@
mb->fcc = re->tables + fcc_offset;
mb->ctypes = re->tables + ctypes_offset;
-/* The match context /R convention, if set, overrides. */
+/* Process the \R and newline settings. */
-mb->bsr_convention = (mcontext->bsr_convention != 0)?
- mcontext->bsr_convention : re->bsr_convention;
-
-/* Process the newline setting. */
-
-newline = (mcontext->newline_convention == 0)?
- re->newline_convention : mcontext->newline_convention;
-
+mb->bsr_convention = re->bsr_convention;
mb->nltype = NLTYPE_FIXED;
-switch(newline)
+switch(re->newline_convention)
{
case PCRE2_NEWLINE_CR:
mb->nllen = 1;
Modified: code/trunk/src/pcre2grep.c
===================================================================
--- code/trunk/src/pcre2grep.c 2014-10-01 16:16:27 UTC (rev 87)
+++ code/trunk/src/pcre2grep.c 2014-10-01 17:02:33 UTC (rev 88)
@@ -3013,7 +3013,7 @@
if (strcmpic(newline_arg, newlines[endlinetype]) == 0) break;
}
if (endlinetype < (int)(sizeof(newlines)/sizeof(char *)))
- pcre2_set_newline_compile(compile_context, endlinetype);
+ pcre2_set_newline(compile_context, endlinetype);
else
{
fprintf(stderr, "pcre2grep: Invalid newline specifier \"%s\"\n",
Modified: code/trunk/src/pcre2test.c
===================================================================
--- code/trunk/src/pcre2test.c 2014-10-01 16:16:27 UTC (rev 87)
+++ code/trunk/src/pcre2test.c 2014-10-01 17:02:33 UTC (rev 88)
@@ -296,8 +296,7 @@
/* Modifier types and applicability */
-enum { MOD_CTB, /* Applies to a compile or a match context */
- MOD_CTC, /* Applies to a compile context */
+enum { MOD_CTC, /* Applies to a compile context */
MOD_CTM, /* Applies to a match context */
MOD_PAT, /* Applies to a pattern */
MOD_PATP, /* Ditto, OK for Perl test */
@@ -424,7 +423,7 @@
{ "anchored", MOD_PD, MOD_OPT, PCRE2_ANCHORED, PD(options) },
{ "auto_callout", MOD_PAT, MOD_OPT, PCRE2_AUTO_CALLOUT, PO(options) },
{ "bincode", MOD_PAT, MOD_CTL, CTL_BINCODE, PO(control) },
- { "bsr", MOD_CTB, MOD_BSR, MO(bsr_convention), CO(bsr_convention) },
+ { "bsr", MOD_CTC, MOD_BSR, 0, CO(bsr_convention) },
{ "callout_capture", MOD_DAT, MOD_CTL, CTL_CALLOUT_CAPTURE, DO(control) },
{ "callout_data", MOD_DAT, MOD_INS, 0, DO(callout_data) },
{ "callout_fail", MOD_DAT, MOD_IN2, 0, DO(cfail) },
@@ -458,7 +457,7 @@
{ "multiline", MOD_PATP, MOD_OPT, PCRE2_MULTILINE, PO(options) },
{ "never_ucp", MOD_PAT, MOD_OPT, PCRE2_NEVER_UCP, PO(options) },
{ "never_utf", MOD_PAT, MOD_OPT, PCRE2_NEVER_UTF, PO(options) },
- { "newline", MOD_CTB, MOD_NL, MO(newline_convention), CO(newline_convention) },
+ { "newline", MOD_CTC, MOD_NL, 0, CO(newline_convention) },
{ "no_auto_capture", MOD_PAT, MOD_OPT, PCRE2_NO_AUTO_CAPTURE, PO(options) },
{ "no_auto_possess", MOD_PATP, MOD_OPT, PCRE2_NO_AUTO_POSSESS, PO(options) },
{ "no_start_optimize", MOD_PATP, MOD_OPT, PCRE2_NO_START_OPTIMIZE, PO(options) },
@@ -2529,17 +2528,11 @@
switch (m->which)
{
- case MOD_CTB: /* Compile or match context modifier */
case MOD_CTC: /* Compile context modifier */
if (ctx == CTX_DEFPAT) field = PTR(default_pat_context);
else if (ctx == CTX_PAT) field = PTR(pat_context);
- if (field != NULL || m->which == MOD_CTC) break;
+ break;
- /* Fall through for something that can also be in a match context. In this
- case the offset is taken from the other field. */
-
- offset = (PCRE2_SIZE)(m->value);
-
case MOD_CTM: /* Match context modifier */
if (ctx == CTX_DEFDAT) field = PTR(default_dat_context);
else if (ctx == CTX_DAT) field = PTR(dat_context);
Modified: code/trunk/testdata/testinput2
===================================================================
--- code/trunk/testdata/testinput2 2014-10-01 16:16:27 UTC (rev 87)
+++ code/trunk/testdata/testinput2 2014-10-01 17:02:33 UTC (rev 88)
@@ -1540,68 +1540,45 @@
\x0b,\x0b
\x0c,\x0d
-/^abc/Im
+/^abc/Im,newline=lf
xyz\nabc
- xyz\nabc>\=newline=lf
- xyz\r\nabc>\=newline=lf
- xyz\rabc>\=newline=cr
- xyz\r\nabclf>\=newline=crlf
+ xyz\r\nabc
** Failers
- xyz\nabc>\=newline=cr
- xyz\r\nabc>\=newline=cr
- xyz\nabclf>\=newline=crlf
- xyz\rabclf>\=newline=crlf
- xyz\rabc>\=newline=lf
-
-/abc$/Im,newline=lf
- xyzabc
- xyzabc\n
- xyzabc\npqr
- xyzabc\r>\=newline=cr
- xyzabc\rpqr>\=newline=cr
- xyzabc\r\nlf>\=newline=crlf
- xyzabc\r\npqrlf>\=newline=crlf
- ** Failers
+ xyz\rabc
xyzabc\r
xyzabc\rpqr
xyzabc\r\n
xyzabc\r\npqr
+/^abc/Im,newline=crlf
+ xyz\r\nabclf>
+ ** Failers
+ xyz\nabclf
+ xyz\rabclf
+
/^abc/Im,newline=cr
- xyz\rabcdef
- xyz\nabcdef>\=newline=lf
+ xyz\rabc
** Failers
- xyz\nabcdef
+ xyz\nabc
+ xyz\r\nabc
-/^abc/Im,newline=lf
- xyz\nabcdef
- xyz\rabcdef>\=newline=cr
- ** Failers
- xyz\rabcdef
-
-/^abc/Im,newline=crlf
- xyz\r\nabcdef
- xyz\rabcdef>\=newline=cr
- ** Failers
- xyz\rabcdef
-
/^abc/Im,newline=bad
-/abc/I
- xyz\rabc\=newline=bad
- abc
-
/.*/I,newline=lf
abc\ndef
abc\rdef
abc\r\ndef
- abc\ndef\=newline=cr
- abc\rdef\=newline=cr
- abc\r\ndef\=newline=cr
- abc\ndef\=newline=crlf
- abc\rdef\=newline=crlf
- abc\r\ndef\=newline=crlf
+/.*/I,newline=cr
+ abc\ndef
+ abc\rdef
+ abc\r\ndef
+
+/.*/I,newline=crlf
+ abc\ndef
+ abc\rdef
+ abc\r\ndef
+
/\w+(.)(.)?def/Is
abc\ndef
abc\rdef
@@ -1920,16 +1897,25 @@
/^a.b/newline=lf
a\rb
- a\nb>\=newline=cr
- a\x85b>\=newline=anycrlf
** Failers
a\nb
- a\nb\=newline=any
- a\rb>\=newline=cr
- a\rb\=newline=any
- a\x85b\=newline=any
- a\rb>\=newline=anycrlf
+/^a.b/newline=cr
+ a\nb
+ ** Failers
+ a\rb
+
+/^a.b/newline=anycrlf
+ a\x85b
+ ** Failers
+ a\rb
+
+/^a.b/newline=any
+ ** Failers
+ a\nb
+ a\rb
+ a\x85b
+
/^abc./gmx,newline=any
abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
@@ -2281,9 +2267,6 @@
a\r\nb
a\x85b
a\x0bb
- ** Failers
- a\x85b\=bsr=anycrlf
- a\x0bb\=bsr=anycrlf
/a\R?b/I,bsr=anycrlf
a\rb
@@ -2299,9 +2282,6 @@
a\r\nb
a\x85b
a\x0bb
- ** Failers
- a\x85b\=bsr=anycrlf
- a\x0bb\=bsr=anycrlf
/a\R{2,4}b/I,bsr=anycrlf
a\r\n\nb
@@ -2319,8 +2299,6 @@
a\x0b\x0bb
** Failers
a\r\r\r\r\rb
- a\x85\x85b\=bsr=anycrlf
- a\x0b\x0bb\=bsr=anycrlf
/(*BSR_ANYCRLF)a\Rb/I
a\nb
Modified: code/trunk/testdata/testinput5
===================================================================
--- code/trunk/testdata/testinput5 2014-10-01 16:16:27 UTC (rev 87)
+++ code/trunk/testdata/testinput5 2014-10-01 17:02:33 UTC (rev 88)
@@ -310,9 +310,6 @@
a\r\nb
a\x{85}b
a\x0bb
- ** Failers
- a\x{85}b\=bsr=anycrlf
- a\x0bb\=bsr=anycrlf
/a\R?b/I,bsr=anycrlf,utf
a\rb
@@ -329,8 +326,6 @@
a\x{85}b
a\x0bb
** Failers
- a\x{85}b\=bsr=anycrlf
- a\x0bb\=bsr=anycrlf
/.*a.*=.b.*/utf,newline=any
QQQ\x{2029}ABCaXYZ=!bPQR
Modified: code/trunk/testdata/testinput6
===================================================================
(Binary files differ)
Modified: code/trunk/testdata/testinput7
===================================================================
--- code/trunk/testdata/testinput7 2014-10-01 16:16:27 UTC (rev 87)
+++ code/trunk/testdata/testinput7 2014-10-01 17:02:33 UTC (rev 88)
@@ -638,9 +638,6 @@
a\r\nb
a\x{85}b
a\x0bb
- ** Failers
- a\x{85}b\=bsr=anycrlf
- a\x0bb\=bsr=anycrlf
/a\R?b/I,bsr=anycrlf,utf
a\rb
@@ -656,9 +653,6 @@
a\r\nb
a\x{85}b
a\x0bb
- ** Failers
- a\x{85}b\=bsr=anycrlf
- a\x0bb\=bsr=anycrlf
/X/newline=any,utf,firstline
A\x{1ec5}ABCXYZ
Modified: code/trunk/testdata/testoutput2
===================================================================
--- code/trunk/testdata/testoutput2 2014-10-01 16:16:27 UTC (rev 87)
+++ code/trunk/testdata/testoutput2 2014-10-01 17:02:33 UTC (rev 88)
@@ -6024,58 +6024,21 @@
\x0c,\x0d
0: \x0c,\x0d
-/^abc/Im
+/^abc/Im,newline=lf
Capturing subpattern count = 0
Options: multiline
+Forced newline is LF
First code unit at start or follows newline
Last code unit = 'c'
Subject length lower bound = 3
xyz\nabc
0: abc
- xyz\nabc>\=newline=lf
+ xyz\r\nabc
0: abc
- xyz\r\nabc>\=newline=lf
- 0: abc
- xyz\rabc>\=newline=cr
- 0: abc
- xyz\r\nabclf>\=newline=crlf
- 0: abc
** Failers
No match
- xyz\nabc>\=newline=cr
+ xyz\rabc
No match
- xyz\r\nabc>\=newline=cr
-No match
- xyz\nabclf>\=newline=crlf
-No match
- xyz\rabclf>\=newline=crlf
-No match
- xyz\rabc>\=newline=lf
-No match
-
-/abc$/Im,newline=lf
-Capturing subpattern count = 0
-Options: multiline
-Forced newline is LF
-First code unit = 'a'
-Last code unit = 'c'
-Subject length lower bound = 3
- xyzabc
- 0: abc
- xyzabc\n
- 0: abc
- xyzabc\npqr
- 0: abc
- xyzabc\r>\=newline=cr
- 0: abc
- xyzabc\rpqr>\=newline=cr
- 0: abc
- xyzabc\r\nlf>\=newline=crlf
- 0: abc
- xyzabc\r\npqrlf>\=newline=crlf
- 0: abc
- ** Failers
-No match
xyzabc\r
No match
xyzabc\rpqr
@@ -6085,67 +6048,41 @@
xyzabc\r\npqr
No match
-/^abc/Im,newline=cr
+/^abc/Im,newline=crlf
Capturing subpattern count = 0
Options: multiline
-Forced newline is CR
+Forced newline is CRLF
First code unit at start or follows newline
Last code unit = 'c'
Subject length lower bound = 3
- xyz\rabcdef
+ xyz\r\nabclf>
0: abc
- xyz\nabcdef>\=newline=lf
- 0: abc
** Failers
No match
- xyz\nabcdef
+ xyz\nabclf
No match
-
-/^abc/Im,newline=lf
-Capturing subpattern count = 0
-Options: multiline
-Forced newline is LF
-First code unit at start or follows newline
-Last code unit = 'c'
-Subject length lower bound = 3
- xyz\nabcdef
- 0: abc
- xyz\rabcdef>\=newline=cr
- 0: abc
- ** Failers
+ xyz\rabclf
No match
- xyz\rabcdef
-No match
-
-/^abc/Im,newline=crlf
+
+/^abc/Im,newline=cr
Capturing subpattern count = 0
Options: multiline
-Forced newline is CRLF
+Forced newline is CR
First code unit at start or follows newline
Last code unit = 'c'
Subject length lower bound = 3
- xyz\r\nabcdef
+ xyz\rabc
0: abc
- xyz\rabcdef>\=newline=cr
- 0: abc
** Failers
No match
- xyz\rabcdef
+ xyz\nabc
No match
+ xyz\r\nabc
+No match
/^abc/Im,newline=bad
** Invalid value in 'newline=bad'
-/abc/I
-Capturing subpattern count = 0
-First code unit = 'a'
-Last code unit = 'c'
-Subject length lower bound = 3
- xyz\rabc\=newline=bad
-** Invalid value in 'newline=bad'
- abc
- 0: abc
-
/.*/I,newline=lf
Capturing subpattern count = 0
May match empty string
@@ -6158,17 +6095,31 @@
0: abc\x0ddef
abc\r\ndef
0: abc\x0d
- abc\ndef\=newline=cr
+
+/.*/I,newline=cr
+Capturing subpattern count = 0
+May match empty string
+Forced newline is CR
+First code unit at start or follows newline
+Subject length lower bound = 0
+ abc\ndef
0: abc\x0adef
- abc\rdef\=newline=cr
+ abc\rdef
0: abc
- abc\r\ndef\=newline=cr
+ abc\r\ndef
0: abc
- abc\ndef\=newline=crlf
+
+/.*/I,newline=crlf
+Capturing subpattern count = 0
+May match empty string
+Forced newline is CRLF
+First code unit at start or follows newline
+Subject length lower bound = 0
+ abc\ndef
0: abc\x0adef
- abc\rdef\=newline=crlf
+ abc\rdef
0: abc\x0ddef
- abc\r\ndef\=newline=crlf
+ abc\r\ndef
0: abc
/\w+(.)(.)?def/Is
@@ -7457,24 +7408,36 @@
/^a.b/newline=lf
a\rb
0: a\x0db
- a\nb>\=newline=cr
- 0: a\x0ab
- a\x85b>\=newline=anycrlf
- 0: a\x85b
** Failers
No match
a\nb
No match
- a\nb\=newline=any
+
+/^a.b/newline=cr
+ a\nb
+ 0: a\x0ab
+ ** Failers
No match
- a\rb>\=newline=cr
+ a\rb
No match
- a\rb\=newline=any
+
+/^a.b/newline=anycrlf
+ a\x85b
+ 0: a\x85b
+ ** Failers
No match
- a\x85b\=newline=any
+ a\rb
No match
- a\rb>\=newline=anycrlf
+
+/^a.b/newline=any
+ ** Failers
No match
+ a\nb
+No match
+ a\rb
+No match
+ a\x85b
+No match
/^abc./gmx,newline=any
abc1 \x0aabc2 \x0babc3xx \x0cabc4 \x0dabc5xx \x0d\x0aabc6 \x85abc7 JUNK
@@ -8499,12 +8462,6 @@
0: a\x85b
a\x0bb
0: a\x0bb
- ** Failers
-No match
- a\x85b\=bsr=anycrlf
-No match
- a\x0bb\=bsr=anycrlf
-No match
/a\R?b/I,bsr=anycrlf
Capturing subpattern count = 0
@@ -8541,12 +8498,6 @@
0: a\x85b
a\x0bb
0: a\x0bb
- ** Failers
-No match
- a\x85b\=bsr=anycrlf
-No match
- a\x0bb\=bsr=anycrlf
-No match
/a\R{2,4}b/I,bsr=anycrlf
Capturing subpattern count = 0
@@ -8587,10 +8538,6 @@
No match
a\r\r\r\r\rb
No match
- a\x85\x85b\=bsr=anycrlf
-No match
- a\x0b\x0bb\=bsr=anycrlf
-No match
/(*BSR_ANYCRLF)a\Rb/I
Capturing subpattern count = 0
Modified: code/trunk/testdata/testoutput5
===================================================================
--- code/trunk/testdata/testoutput5 2014-10-01 16:16:27 UTC (rev 87)
+++ code/trunk/testdata/testoutput5 2014-10-01 17:02:33 UTC (rev 88)
@@ -779,12 +779,6 @@
0: a\x{85}b
a\x0bb
0: a\x{0b}b
- ** Failers
-No match
- a\x{85}b\=bsr=anycrlf
-No match
- a\x0bb\=bsr=anycrlf
-No match
/a\R?b/I,bsr=anycrlf,utf
Capturing subpattern count = 0
@@ -825,10 +819,6 @@
0: a\x{0b}b
** Failers
No match
- a\x{85}b\=bsr=anycrlf
-No match
- a\x0bb\=bsr=anycrlf
-No match
/.*a.*=.b.*/utf,newline=any
QQQ\x{2029}ABCaXYZ=!bPQR
Modified: code/trunk/testdata/testoutput6
===================================================================
(Binary files differ)
Modified: code/trunk/testdata/testoutput7
===================================================================
--- code/trunk/testdata/testoutput7 2014-10-01 16:16:27 UTC (rev 87)
+++ code/trunk/testdata/testoutput7 2014-10-01 17:02:33 UTC (rev 88)
@@ -1139,12 +1139,6 @@
0: a\x{85}b
a\x0bb
0: a\x{0b}b
- ** Failers
-No match
- a\x{85}b\=bsr=anycrlf
-No match
- a\x0bb\=bsr=anycrlf
-No match
/a\R?b/I,bsr=anycrlf,utf
Capturing subpattern count = 0
@@ -1183,12 +1177,6 @@
0: a\x{85}b
a\x0bb
0: a\x{0b}b
- ** Failers
-No match
- a\x{85}b\=bsr=anycrlf
-No match
- a\x0bb\=bsr=anycrlf
-No match
/X/newline=any,utf,firstline
A\x{1ec5}ABCXYZ