/usr/share/doc/monotone/html/Regexp-Summary.html is in monotone-doc 1.1-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.0, http://www.gnu.org/software/texinfo/ -->
<head>
<title>monotone documentation: Regexp Summary</title>
<meta name="description" content="monotone documentation: Regexp Summary">
<meta name="keywords" content="monotone documentation: Regexp Summary">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="General-Index.html#General-Index" rel="index" title="General Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Regexps.html#Regexps" rel="up" title="Regexps">
<link href="Regexp-Details.html#Regexp-Details" rel="next" title="Regexp Details">
<link href="Regexps.html#Regexps" rel="prev" title="Regexps">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space: nowrap}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: serif; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="texinfo.css">
</head>
<body lang="en">
<a name="Regexp-Summary"></a>
<div class="header">
<p>
Next: <a href="Regexp-Details.html#Regexp-Details" accesskey="n" rel="next">Regexp Details</a>, Up: <a href="Regexps.html#Regexps" accesskey="u" rel="up">Regexps</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="General-Index.html#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Regexp-Syntax-Summary"></a>
<h4 class="subsection">7.4.1 Regexp Syntax Summary</h4>
<p>This is a quick-reference summary of the regular expression syntax
used in Monotone.
</p>
<a name="Quoting"></a>
<h4 class="subsubheading">Quoting</h4>
<dl compact="compact">
<dt><code>\<var>x</var></code></dt>
<dd><p>where <var>x</var> is non-alphanumeric is a literal <var>x</var>
</p></dd>
<dt><code>\Q...\E</code></dt>
<dd><p>treat enclosed characters as literal
</p></dd>
</dl>
<a name="Characters"></a>
<h4 class="subsubheading">Characters</h4>
<dl compact="compact">
<dt><code>\a</code></dt>
<dd><p>alarm, that is, the BEL character (hex 07)
</p></dd>
<dt><code>\c<var>x</var></code></dt>
<dd><p>“control-<var>x</var>”, where <var>x</var> is any character
</p></dd>
<dt><code>\e</code></dt>
<dd><p>escape (hex 1B)
</p></dd>
<dt><code>\f</code></dt>
<dd><p>formfeed (hex 0C)
</p></dd>
<dt><code>\n</code></dt>
<dd><p>newline (hex 0A)
</p></dd>
<dt><code>\r</code></dt>
<dd><p>carriage return (hex 0D)
</p></dd>
<dt><code>\t</code></dt>
<dd><p>tab (hex 09)
</p></dd>
<dt><code>\<var>ddd</var></code></dt>
<dd><p>character with octal code <var>ddd</var>, or backreference
</p></dd>
<dt><code>\x<var>hh</var></code></dt>
<dd><p>character with hex code <var>hh</var>
</p></dd>
<dt><code>\x{<var>hhh...</var>}</code></dt>
<dd><p>character with hex code <var>hhh...</var>
</p></dd>
</dl>
<a name="Character-Types"></a>
<h4 class="subsubheading">Character Types</h4>
<dl compact="compact">
<dt><code>.</code></dt>
<dd><p>any character except newline;
in dotall mode, any character whatsoever
</p></dd>
<dt><code>\C</code></dt>
<dd><p>one byte, even in UTF-8 mode (best avoided)
</p></dd>
<dt><code>\d</code></dt>
<dd><p>a decimal digit
</p></dd>
<dt><code>\D</code></dt>
<dd><p>a character that is not a decimal digit
</p></dd>
<dt><code>\h</code></dt>
<dd><p>a horizontal whitespace character
</p></dd>
<dt><code>\H</code></dt>
<dd><p>a character that is not a horizontal whitespace character
</p></dd>
<dt><code>\p{<var>xx</var>}</code></dt>
<dd><p>a character with the <var>xx</var> property
</p></dd>
<dt><code>\P{<var>xx</var>}</code></dt>
<dd><p>a character without the <var>xx</var> property
</p></dd>
<dt><code>\R</code></dt>
<dd><p>a newline sequence
</p></dd>
<dt><code>\s</code></dt>
<dd><p>a whitespace character
</p></dd>
<dt><code>\S</code></dt>
<dd><p>a character that is not a whitespace character
</p></dd>
<dt><code>\v</code></dt>
<dd><p>a vertical whitespace character
</p></dd>
<dt><code>\V</code></dt>
<dd><p>a character that is not a vertical whitespace character
</p></dd>
<dt><code>\w</code></dt>
<dd><p>a “word” character
</p></dd>
<dt><code>\W</code></dt>
<dd><p>a “non-word” character
</p></dd>
<dt><code>\X</code></dt>
<dd><p>an extended Unicode sequence
</p></dd>
</dl>
<p>‘<samp>\d</samp>’, ‘<samp>\D</samp>’, ‘<samp>\s</samp>’, ‘<samp>\S</samp>’, ‘<samp>\w</samp>’, and ‘<samp>\W</samp>’
recognize only ASCII characters.
</p>
<a name="General-category-property-codes-for-_005cp-and-_005cP"></a>
<h4 class="subsubheading">General category property codes for ‘<samp>\p</samp>’ and ‘<samp>\P</samp>’</h4>
<dl compact="compact">
<dt><code>C</code></dt>
<dd><p>Other
</p></dd>
<dt><code>Cc</code></dt>
<dd><p>Control
</p></dd>
<dt><code>Cf</code></dt>
<dd><p>Format
</p></dd>
<dt><code>Cn</code></dt>
<dd><p>Unassigned
</p></dd>
<dt><code>Co</code></dt>
<dd><p>Private use
</p></dd>
<dt><code>Cs</code></dt>
<dd><p>Surrogate
</p>
</dd>
<dt><code>L</code></dt>
<dd><p>Letter
</p></dd>
<dt><code>Ll</code></dt>
<dd><p>Lower case letter
</p></dd>
<dt><code>Lm</code></dt>
<dd><p>Modifier letter
</p></dd>
<dt><code>Lo</code></dt>
<dd><p>Other letter
</p></dd>
<dt><code>Lt</code></dt>
<dd><p>Title case letter
</p></dd>
<dt><code>Lu</code></dt>
<dd><p>Upper case letter
</p></dd>
<dt><code>L&</code></dt>
<dd><p>Ll, Lu, or Lt
</p>
</dd>
<dt><code>M</code></dt>
<dd><p>Mark
</p></dd>
<dt><code>Mc</code></dt>
<dd><p>Spacing mark
</p></dd>
<dt><code>Me</code></dt>
<dd><p>Enclosing mark
</p></dd>
<dt><code>Mn</code></dt>
<dd><p>Non-spacing mark
</p>
</dd>
<dt><code>N</code></dt>
<dd><p>Number
</p></dd>
<dt><code>Nd</code></dt>
<dd><p>Decimal number
</p></dd>
<dt><code>Nl</code></dt>
<dd><p>Letter number
</p></dd>
<dt><code>No</code></dt>
<dd><p>Other number
</p>
</dd>
<dt><code>P</code></dt>
<dd><p>Punctuation
</p></dd>
<dt><code>Pc</code></dt>
<dd><p>Connector punctuation
</p></dd>
<dt><code>Pd</code></dt>
<dd><p>Dash punctuation
</p></dd>
<dt><code>Pe</code></dt>
<dd><p>Close punctuation
</p></dd>
<dt><code>Pf</code></dt>
<dd><p>Final punctuation
</p></dd>
<dt><code>Pi</code></dt>
<dd><p>Initial punctuation
</p></dd>
<dt><code>Po</code></dt>
<dd><p>Other punctuation
</p></dd>
<dt><code>Ps</code></dt>
<dd><p>Open punctuation
</p>
</dd>
<dt><code>S</code></dt>
<dd><p>Symbol
</p></dd>
<dt><code>Sc</code></dt>
<dd><p>Currency symbol
</p></dd>
<dt><code>Sk</code></dt>
<dd><p>Modifier symbol
</p></dd>
<dt><code>Sm</code></dt>
<dd><p>Mathematical symbol
</p></dd>
<dt><code>So</code></dt>
<dd><p>Other symbol
</p>
</dd>
<dt><code>Z</code></dt>
<dd><p>Separator
</p></dd>
<dt><code>Zl</code></dt>
<dd><p>Line separator
</p></dd>
<dt><code>Zp</code></dt>
<dd><p>Paragraph separator
</p></dd>
<dt><code>Zs</code></dt>
<dd><p>Space separator
</p></dd>
</dl>
<a name="Script-names-for-_005cp-and-_005cP"></a>
<h4 class="subsubheading">Script names for ‘<samp>\p</samp>’ and ‘<samp>\P</samp>’</h4>
<p>Arabic,
Armenian,
Balinese,
Bengali,
Bopomofo,
Braille,
Buginese,
Buhid,
Canadian_Aboriginal,
Cherokee,
Common,
Coptic,
Cuneiform,
Cypriot,
Cyrillic,
Deseret,
Devanagari,
Ethiopic,
Georgian,
Glagolitic,
Gothic,
Greek,
Gujarati,
Gurmukhi,
Han,
Hangul,
Hanunoo,
Hebrew,
Hiragana,
Inherited,
Kannada,
Katakana,
Kharoshthi,
Khmer,
Lao,
Latin,
Limbu,
Linear_B,
Malayalam,
Mongolian,
Myanmar,
New_Tai_Lue,
Nko,
Ogham,
Old_Italic,
Old_Persian,
Oriya,
Osmanya,
Phags_Pa,
Phoenician,
Runic,
Shavian,
Sinhala,
Syloti_Nagri,
Syriac,
Tagalog,
Tagbanwa,
Tai_Le,
Tamil,
Telugu,
Thaana,
Thai,
Tibetan,
Tifinagh,
Ugaritic,
Yi.
</p>
<a name="Character-Classes"></a>
<h4 class="subsubheading">Character Classes</h4>
<dl compact="compact">
<dt><code>[...]</code></dt>
<dd><p>positive character class
</p></dd>
<dt><code>[^...]</code></dt>
<dd><p>negative character class
</p></dd>
<dt><code>[<var>x</var>-<var>y</var>]</code></dt>
<dd><p>range (can be used for hex characters)
</p></dd>
<dt><code>[[:<var>xxx</var>:]]</code></dt>
<dd><p>positive POSIX named set
</p></dd>
<dt><code>[[:^<var>xxx</var>:]]</code></dt>
<dd><p>negative POSIX named set
</p>
</dd>
<dt><code>alnum</code></dt>
<dd><p>alphanumeric
</p></dd>
<dt><code>alpha</code></dt>
<dd><p>alphabetic
</p></dd>
<dt><code>ascii</code></dt>
<dd><p>0-127
</p></dd>
<dt><code>blank</code></dt>
<dd><p>space or tab
</p></dd>
<dt><code>cntrl</code></dt>
<dd><p>control character
</p></dd>
<dt><code>digit</code></dt>
<dd><p>decimal digit
</p></dd>
<dt><code>graph</code></dt>
<dd><p>printing, excluding space
</p></dd>
<dt><code>lower</code></dt>
<dd><p>lower case letter
</p></dd>
<dt><code>print</code></dt>
<dd><p>printing, including space
</p></dd>
<dt><code>punct</code></dt>
<dd><p>printing, excluding alphanumeric
</p></dd>
<dt><code>space</code></dt>
<dd><p>whitespace
</p></dd>
<dt><code>upper</code></dt>
<dd><p>upper case letter
</p></dd>
<dt><code>word</code></dt>
<dd><p>same as ‘<samp>\w</samp>’
</p></dd>
<dt><code>xdigit</code></dt>
<dd><p>hexadecimal digit
</p></dd>
</dl>
<p>In PCRE, POSIX character set names recognize only ASCII
characters. You can use ‘<samp>\Q...\E</samp>’ inside a character class.
</p>
<a name="Quantifiers"></a>
<h4 class="subsubheading">Quantifiers</h4>
<dl compact="compact">
<dt><code>?</code></dt>
<dd><p>0 or 1, greedy
</p></dd>
<dt><code>?+</code></dt>
<dd><p>0 or 1, possessive
</p></dd>
<dt><code>??</code></dt>
<dd><p>0 or 1, lazy
</p></dd>
<dt><code>*</code></dt>
<dd><p>0 or more, greedy
</p></dd>
<dt><code>*+</code></dt>
<dd><p>0 or more, possessive
</p></dd>
<dt><code>*?</code></dt>
<dd><p>0 or more, lazy
</p></dd>
<dt><code>+</code></dt>
<dd><p>1 or more, greedy
</p></dd>
<dt><code>++</code></dt>
<dd><p>1 or more, possessive
</p></dd>
<dt><code>+?</code></dt>
<dd><p>1 or more, lazy
</p></dd>
<dt><code>{<var>n</var>}</code></dt>
<dd><p>exactly <var>n</var>
</p></dd>
<dt><code>{<var>n</var>,<var>m</var>}</code></dt>
<dd><p>at least <var>n</var>, no more than <var>m</var>, greedy
</p></dd>
<dt><code>{<var>n</var>,<var>m</var>}+</code></dt>
<dd><p>at least <var>n</var>, no more than <var>m</var>, possessive
</p></dd>
<dt><code>{<var>n</var>,<var>m</var>}?</code></dt>
<dd><p>at least <var>n</var>, no more than <var>m</var>, lazy
</p></dd>
<dt><code>{<var>n</var>,}</code></dt>
<dd><p><var>n</var> or more, greedy
</p></dd>
<dt><code>{<var>n</var>,}+</code></dt>
<dd><p><var>n</var> or more, possessive
</p></dd>
<dt><code>{<var>n</var>,}?</code></dt>
<dd><p><var>n</var> or more, lazy
</p></dd>
</dl>
<a name="Anchors-and-Simple-Assertions"></a>
<h4 class="subsubheading">Anchors and Simple Assertions</h4>
<dl compact="compact">
<dt><code>\b</code></dt>
<dd><p>word boundary
</p></dd>
<dt><code>\B</code></dt>
<dd><p>not a word boundary
</p></dd>
<dt><code>^</code></dt>
<dd><p>start of subject
also after internal newline in multiline mode
</p></dd>
<dt><code>\A</code></dt>
<dd><p>start of subject
</p></dd>
<dt><code>$</code></dt>
<dd><p>end of subject
also before newline at end of subject
also before internal newline in multiline mode
</p></dd>
<dt><code>\Z</code></dt>
<dd><p>end of subject
also before newline at end of subject
</p></dd>
<dt><code>\z</code></dt>
<dd><p>end of subject
</p></dd>
<dt><code>\G</code></dt>
<dd><p>first matching position in subject
</p></dd>
</dl>
<a name="Match-Point-Reset"></a>
<h4 class="subsubheading">Match Point Reset</h4>
<dl compact="compact">
<dt><code>\K</code></dt>
<dd><p>reset start of match
</p></dd>
</dl>
<a name="Alternation"></a>
<h4 class="subsubheading">Alternation</h4>
<dl compact="compact">
<dt><code><var>expr</var>|<var>expr</var>|<var>expr</var>...</code></dt>
</dl>
<a name="Capturing"></a>
<h4 class="subsubheading">Capturing</h4>
<dl compact="compact">
<dt><code>(...)</code></dt>
<dd><p>capturing group
</p></dd>
<dt><code>(?<<var>name</var>>...)</code></dt>
<dd><p>named capturing group (like Perl)
</p></dd>
<dt><code>(?'<var>name</var>'...)</code></dt>
<dd><p>named capturing group (like Perl)
</p></dd>
<dt><code>(?P<<var>name</var>>...)</code></dt>
<dd><p>named capturing group (like Python)
</p></dd>
<dt><code>(?:...)</code></dt>
<dd><p>non-capturing group
</p></dd>
<dt><code>(?|...)</code></dt>
<dd><p>non-capturing group; reset group numbers for
capturing groups in each alternative
</p></dd>
</dl>
<a name="Atomic-Groups"></a>
<h4 class="subsubheading">Atomic Groups</h4>
<dl compact="compact">
<dt><code>(?>...)</code></dt>
<dd><p>atomic, non-capturing group
</p></dd>
</dl>
<a name="Comment"></a>
<h4 class="subsubheading">Comment</h4>
<dl compact="compact">
<dt><code>(?#....)</code></dt>
<dd><p>comment (not nestable)
</p></dd>
</dl>
<a name="Option-Setting"></a>
<h4 class="subsubheading">Option Setting</h4>
<dl compact="compact">
<dt><code>(?i)</code></dt>
<dd><p>caseless
</p></dd>
<dt><code>(?J)</code></dt>
<dd><p>allow duplicate names
</p></dd>
<dt><code>(?m)</code></dt>
<dd><p>multiline
</p></dd>
<dt><code>(?s)</code></dt>
<dd><p>single line (dotall)
</p></dd>
<dt><code>(?U)</code></dt>
<dd><p>default ungreedy (lazy)
</p></dd>
<dt><code>(?x)</code></dt>
<dd><p>extended (ignore white space)
</p></dd>
<dt><code>(?-...)</code></dt>
<dd><p>unset option(s)
</p></dd>
</dl>
<a name="Lookahead-and-Lookbehind-Assertions"></a>
<h4 class="subsubheading">Lookahead and Lookbehind Assertions</h4>
<dl compact="compact">
<dt><code>(?=...)</code></dt>
<dd><p>positive look ahead
</p></dd>
<dt><code>(?!...)</code></dt>
<dd><p>negative look ahead
</p></dd>
<dt><code>(?<=...)</code></dt>
<dd><p>positive look behind
</p></dd>
<dt><code>(?<!...)</code></dt>
<dd><p>negative look behind
</p></dd>
</dl>
<p>Each top-level branch of a look behind must be of a fixed length.
</p>
<a name="Backreferences"></a>
<h4 class="subsubheading">Backreferences</h4>
<dl compact="compact">
<dt><code>\<var>n</var></code></dt>
<dd><p>reference by number (can be ambiguous)
</p></dd>
<dt><code>\g<var>n</var></code></dt>
<dd><p>reference by number
</p></dd>
<dt><code>\g{<var>n</var>}</code></dt>
<dd><p>reference by number
</p></dd>
<dt><code>\g{-<var>n</var>}</code></dt>
<dd><p>relative reference by number
</p></dd>
<dt><code>\k<<var>name</var>></code></dt>
<dd><p>reference by name (like Perl)
</p></dd>
<dt><code>\k'<var>name</var>'</code></dt>
<dd><p>reference by name (like Perl)
</p></dd>
<dt><code>\g{<var>name</var>}</code></dt>
<dd><p>reference by name (like Perl)
</p></dd>
<dt><code>\k{<var>name</var>}</code></dt>
<dd><p>reference by name (like .NET)
</p></dd>
<dt><code>(?P=<var>name</var>)</code></dt>
<dd><p>reference by name (like Python)
</p></dd>
</dl>
<a name="Subroutine-References-_0028possibly-recursive_0029"></a>
<h4 class="subsubheading">Subroutine References (possibly recursive)</h4>
<dl compact="compact">
<dt><code>(?R)</code></dt>
<dd><p>recurse whole pattern
</p></dd>
<dt><code>(?<var>n</var>)</code></dt>
<dd><p>call subpattern by absolute number
</p></dd>
<dt><code>(?+<var>n</var>)</code></dt>
<dd><p>call subpattern by relative number
</p></dd>
<dt><code>(?-<var>n</var>)</code></dt>
<dd><p>call subpattern by relative number
</p></dd>
<dt><code>(?&<var>name</var>)</code></dt>
<dd><p>call subpattern by name (like Perl)
</p></dd>
<dt><code>(?P><var>name</var>)</code></dt>
<dd><p>call subpattern by name (like Python)
</p></dd>
</dl>
<a name="Conditional-Patterns"></a>
<h4 class="subsubheading">Conditional Patterns</h4>
<dl compact="compact">
<dt><code>(?(<var>condition</var>)<var>yes-pattern</var>)</code></dt>
<dt><code>(?(<var>condition</var>)<var>yes-pattern</var>|<var>no-pattern</var>)</code></dt>
<dt><code>(?(<var>n</var>)...</code></dt>
<dd><p>absolute reference condition
</p></dd>
<dt><code>(?(+<var>n</var>)...</code></dt>
<dd><p>relative reference condition
</p></dd>
<dt><code>(?(-<var>n</var>)...</code></dt>
<dd><p>relative reference condition
</p></dd>
<dt><code>(?(<<var>name</var>>)...</code></dt>
<dd><p>named reference condition (like Perl)
</p></dd>
<dt><code>(?('<var>name</var>')...</code></dt>
<dd><p>named reference condition (like Perl)
</p></dd>
<dt><code>(?(<var>name</var>)...</code></dt>
<dd><p>named reference condition (PCRE only)
</p></dd>
<dt><code>(?(R)...</code></dt>
<dd><p>overall recursion condition
</p></dd>
<dt><code>(?(R<var>n</var>)...</code></dt>
<dd><p>specific group recursion condition
</p></dd>
<dt><code>(?(R&<var>name</var>)...</code></dt>
<dd><p>specific recursion condition
</p></dd>
<dt><code>(?(DEFINE)...</code></dt>
<dd><p>define subpattern for reference
</p></dd>
<dt><code>(?(assert)...</code></dt>
<dd><p>assertion condition
</p></dd>
</dl>
<a name="Backtracking-Control"></a>
<h4 class="subsubheading">Backtracking Control</h4>
<p>The following act immediately they are reached:
</p>
<dl compact="compact">
<dt><code>(*ACCEPT)</code></dt>
<dd><p>force successful match
</p></dd>
<dt><code>(*FAIL)</code></dt>
<dd><p>force backtrack; synonym ‘<samp>(*F)</samp>’
</p></dd>
</dl>
<p>The following act only when a subsequent match failure causes a backtrack to
reach them. They all force a match failure, but they differ in what happens
afterwards. Those that advance the start-of-match point do so only if the
pattern is not anchored.
</p>
<dl compact="compact">
<dt><code>(*COMMIT)</code></dt>
<dd><p>overall failure, no advance of starting point
</p></dd>
<dt><code>(*PRUNE)</code></dt>
<dd><p>advance to next starting character
</p></dd>
<dt><code>(*SKIP)</code></dt>
<dd><p>advance start to current matching position
</p></dd>
<dt><code>(*THEN)</code></dt>
<dd><p>local failure, backtrack to next alternation
</p></dd>
</dl>
<a name="Newline-Conventions"></a>
<h4 class="subsubheading">Newline Conventions</h4>
<p>These are recognized only at the very start of the pattern or after a
‘<samp>(*BSR_...)</samp>’ option.
</p>
<dl compact="compact">
<dt><code>(*CR)</code></dt>
<dt><code>(*LF)</code></dt>
<dt><code>(*CRLF)</code></dt>
<dt><code>(*ANYCRLF)</code></dt>
<dt><code>(*ANY)</code></dt>
</dl>
<a name="What-_005cR-Matches"></a>
<h4 class="subsubheading">What ‘<samp>\R</samp>’ Matches</h4>
<p>These are recognized only at the very start of the pattern or after a
‘<samp>(*...)</samp>’ option that sets the newline convention.
</p>
<dl compact="compact">
<dt><code>(*BSR_ANYCRLF)</code></dt>
<dt><code>(*BSR_UNICODE)</code></dt>
</dl>
<hr>
<div class="header">
<p>
Next: <a href="Regexp-Details.html#Regexp-Details" accesskey="n" rel="next">Regexp Details</a>, Up: <a href="Regexps.html#Regexps" accesskey="u" rel="up">Regexps</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="General-Index.html#General-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|