| 558 |
the first newline in the subject string, though the matched text may continue |
the first newline in the subject string, though the matched text may continue |
| 559 |
over the newline. |
over the newline. |
| 560 |
<pre> |
<pre> |
| 561 |
|
PCRE_JAVASCRIPT_COMPAT |
| 562 |
|
</pre> |
| 563 |
|
If this option is set, PCRE's behaviour is changed in some ways so that it is |
| 564 |
|
compatible with JavaScript rather than Perl. The changes are as follows: |
| 565 |
|
</P> |
| 566 |
|
<P> |
| 567 |
|
(1) A lone closing square bracket in a pattern causes a compile-time error, |
| 568 |
|
because this is illegal in JavaScript (by default it is treated as a data |
| 569 |
|
character). Thus, the pattern AB]CD becomes illegal when this option is set. |
| 570 |
|
</P> |
| 571 |
|
<P> |
| 572 |
|
(2) At run time, a back reference to an unset subpattern group matches an empty |
| 573 |
|
string (by default this causes the current matching alternative to fail). A |
| 574 |
|
pattern such as (\1)(a) succeeds when this option is set (assuming it can find |
| 575 |
|
an "a" in the subject), whereas it fails by default, for Perl compatibility. |
| 576 |
|
<pre> |
| 577 |
PCRE_MULTILINE |
PCRE_MULTILINE |
| 578 |
</pre> |
</pre> |
| 579 |
By default, PCRE treats the subject string as consisting of a single line of |
By default, PCRE treats the subject string as consisting of a single line of |
| 734 |
54 DEFINE group contains more than one branch |
54 DEFINE group contains more than one branch |
| 735 |
55 repeating a DEFINE group is not allowed |
55 repeating a DEFINE group is not allowed |
| 736 |
56 inconsistent NEWLINE options |
56 inconsistent NEWLINE options |
| 737 |
57 \g is not followed by a braced name or an optionally braced |
57 \g is not followed by a braced, angle-bracketed, or quoted |
| 738 |
non-zero number |
name/number or by a plain number |
| 739 |
58 (?+ or (?- or (?(+ or (?(- must be followed by a non-zero number |
58 a numbered reference must not be zero |
| 740 |
59 (*VERB) with an argument is not supported |
59 (*VERB) with an argument is not supported |
| 741 |
60 (*VERB) not recognized |
60 (*VERB) not recognized |
| 742 |
61 number is too big |
61 number is too big |
| 743 |
62 subpattern name expected |
62 subpattern name expected |
| 744 |
63 digit expected after (?+ |
63 digit expected after (?+ |
| 745 |
|
64 ] is an invalid data character in JavaScript compatibility mode |
| 746 |
</pre> |
</pre> |
| 747 |
The numbers 32 and 10000 in errors 48 and 49 are defaults; different values may |
The numbers 32 and 10000 in errors 48 and 49 are defaults; different values may |
| 748 |
be used if the limits were changed when PCRE was built. |
be used if the limits were changed when PCRE was built. |
| 1972 |
</P> |
</P> |
| 1973 |
<br><a name="SEC22" href="#TOC1">REVISION</a><br> |
<br><a name="SEC22" href="#TOC1">REVISION</a><br> |
| 1974 |
<P> |
<P> |
| 1975 |
Last updated: 23 January 2008 |
Last updated: 12 April 2008 |
| 1976 |
<br> |
<br> |
| 1977 |
Copyright © 1997-2008 University of Cambridge. |
Copyright © 1997-2008 University of Cambridge. |
| 1978 |
<br> |
<br> |