summaryrefslogtreecommitdiff
path: root/doc/html/pcre2test.html
diff options
context:
space:
mode:
authorph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2015-09-12 18:12:01 +0000
committerph10 <ph10@6239d852-aaf2-0410-a92c-79f79f948069>2015-09-12 18:12:01 +0000
commit1543adcb24ac49ea3b73df7834cb766abdbd0b78 (patch)
tree84da3b8080f3b660ad145e7390c659b41de60043 /doc/html/pcre2test.html
parent7a5a6ccf2d9f9c16a9298a902cfd0df41b1318a7 (diff)
downloadpcre2-1543adcb24ac49ea3b73df7834cb766abdbd0b78.tar.gz
Update HTML documentation.
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@369 6239d852-aaf2-0410-a92c-79f79f948069
Diffstat (limited to 'doc/html/pcre2test.html')
-rw-r--r--doc/html/pcre2test.html94
1 files changed, 78 insertions, 16 deletions
diff --git a/doc/html/pcre2test.html b/doc/html/pcre2test.html
index de3c779..56421c8 100644
--- a/doc/html/pcre2test.html
+++ b/doc/html/pcre2test.html
@@ -305,6 +305,36 @@ This command is used to load a set of precompiled patterns from a file, as
described in the section entitled "Saving and restoring compiled patterns"
<a href="#saverestore">below.</a>
<pre>
+ #newline_default [&#60;newline-list&#62;]
+</pre>
+When PCRE2 is built, a default newline convention can be specified. This
+determines which characters and/or character pairs are recognized as indicating
+a newline in a pattern or subject string. The default can be overridden when a
+pattern is compiled. The standard test files contain tests of various newline
+conventions, but the majority of the tests expect a single linefeed to be
+recognized as a newline by default. Without special action the tests would fail
+when PCRE2 is compiled with either CR or CRLF as the default newline.
+</P>
+<P>
+The #newline_default command specifies a list of newline types that are
+acceptable as the default. The types must be one of CR, LF, CRLF, ANYCRLF, or
+ANY (in upper or lower case), for example:
+<pre>
+ #newline_default LF Any anyCRLF
+</pre>
+If the default newline is in the list, this command has no effect. Otherwise,
+except when testing the POSIX API, a <b>newline</b> modifier that specifies the
+first newline convention in the list (LF in the above example) is added to any
+pattern that does not already have a <b>newline</b> modifier. If the newline
+list is empty, the feature is turned off. This command is present in a number
+of the standard test input files.
+</P>
+<P>
+When the POSIX API is being tested there is no way to override the default
+newline convention, though it is possible to set the newline convention from
+within the pattern. A warning is given if the <b>posix</b> modifier is used when
+<b>#newline_default</b> would set a default for the non-POSIX API.
+<pre>
#pattern &#60;modifier-list&#62;
</pre>
This command sets a default modifier list that applies to all subsequent
@@ -480,7 +510,7 @@ for a description of their effects.
allow_empty_class set PCRE2_ALLOW_EMPTY_CLASS
alt_bsux set PCRE2_ALT_BSUX
alt_circumflex set PCRE2_ALT_CIRCUMFLEX
- alt_verbnames set PCRE2_ALT_VERBNAMES
+ alt_verbnames set PCRE2_ALT_VERBNAMES
anchored set PCRE2_ANCHORED
auto_callout set PCRE2_AUTO_CALLOUT
/i caseless set PCRE2_CASELESS
@@ -625,21 +655,51 @@ actual length of the pattern is passed.
JIT compilation
</b><br>
<P>
-The <b>/jit</b> modifier may optionally be followed by an equals sign and a
-number in the range 0 to 7:
+Just-in-time (JIT) compiling is a heavyweight optimization that can greatly
+speed up pattern matching. See the
+<a href="pcre2jit.html"><b>pcre2jit</b></a>
+documentation for details. JIT compiling happens, optionally, after a pattern
+has been successfully compiled into an internal form. The JIT compiler converts
+this to optimized machine code. It needs to know whether the match-time options
+PCRE2_PARTIAL_HARD and PCRE2_PARTIAL_SOFT are going to be used, because
+different code is generated for the different cases. See the <b>partial</b>
+modifier in "Subject Modifiers"
+<a href="#subjectmodifiers">below</a>
+for details of how these options are specified for each match attempt.
+</P>
+<P>
+JIT compilation is requested by the <b>/jit</b> pattern modifier, which may
+optionally be followed by an equals sign and a number in the range 0 to 7.
+The three bits that make up the number specify which of the three JIT operating
+modes are to be compiled:
+<pre>
+ 1 compile JIT code for non-partial matching
+ 2 compile JIT code for soft partial matching
+ 4 compile JIT code for hard partial matching
+</pre>
+The possible values for the <b>/jit</b> modifier are therefore:
<pre>
0 disable JIT
- 1 use JIT for normal match only
- 2 use JIT for soft partial match only
- 3 use JIT for normal match and soft partial match
- 4 use JIT for hard partial match only
- 6 use JIT for soft and hard partial match
+ 1 normal matching only
+ 2 soft partial matching only
+ 3 normal and soft partial matching
+ 4 hard partial matching only
+ 6 soft and hard partial matching only
7 all three modes
</pre>
-If no number is given, 7 is assumed. If JIT compilation is successful, the
-compiled JIT code will automatically be used when <b>pcre2_match()</b> is run
-for the appropriate type of match, except when incompatible run-time options
-are specified. For more details, see the
+If no number is given, 7 is assumed. The phrase "partial matching" means a call
+to <b>pcre2_match()</b> with either the PCRE2_PARTIAL_SOFT or the
+PCRE2_PARTIAL_HARD option set. Note that such a call may return a complete
+match; the options enable the possibility of a partial match, but do not
+require it. Note also that if you request JIT compilation only for partial
+matching (for example, /jit=2) but do not set the <b>partial</b> modifier on a
+subject line, that match will not use JIT code because none was compiled for
+non-partial matching.
+</P>
+<P>
+If JIT compilation is successful, the compiled JIT code will automatically be
+used when an appropriate type of match is run, except when incompatible
+run-time options are specified. For more details, see the
<a href="pcre2jit.html"><b>pcre2jit</b></a>
documentation. See also the <b>jitstack</b> modifier below for a way of
setting the size of the JIT stack.
@@ -707,8 +767,10 @@ Using the POSIX wrapper API
<P>
The <b>/posix</b> modifier causes <b>pcre2test</b> to call PCRE2 via the POSIX
wrapper API rather than its native API. This supports only the 8-bit library.
-When the POSIX API is being used, the following pattern modifiers set options
-for the <b>regcomp()</b> function:
+Note that it does not imply POSIX matching semantics; for more detail see the
+<a href="pcre2posix.html"><b>pcre2posix</b></a>
+documentation. When the POSIX API is being used, the following pattern
+modifiers set options for the <b>regcomp()</b> function:
<pre>
caseless REG_ICASE
multiline REG_NEWLINE
@@ -790,7 +852,7 @@ The <b>push</b> modifier is incompatible with compilation modifiers such as
warning message, except for <b>replace</b>, which causes an error. Note that,
<b>jitverify</b>, which is allowed, does not carry through to any subsequent
matching that uses this pattern.
-</P>
+<a name="subjectmodifiers"></a></P>
<br><a name="SEC11" href="#TOC1">SUBJECT MODIFIERS</a><br>
<P>
The modifiers that can appear in subject lines and the <b>#subject</b>
@@ -1471,7 +1533,7 @@ Cambridge, England.
</P>
<br><a name="SEC21" href="#TOC1">REVISION</a><br>
<P>
-Last updated: 30 August 2015
+Last updated: 12 September 2015
<br>
Copyright &copy; 1997-2015 University of Cambridge.
<br>