1[/ 2 Copyright 2006-2007 John Maddock. 3 Distributed under the Boost Software License, Version 1.0. 4 (See accompanying file LICENSE_1_0.txt or copy at 5 http://www.boost.org/LICENSE_1_0.txt). 6] 7 8 9[section:perl_syntax Perl Regular Expression Syntax] 10 11[h3 Synopsis] 12 13The Perl regular expression syntax is based on that used by the 14programming language Perl . Perl regular expressions are the 15default behavior in Boost.Regex or you can pass the flag [^perl] to the 16[basic_regex] constructor, for example: 17 18 // e1 is a case sensitive Perl regular expression: 19 // since Perl is the default option there's no need to explicitly specify the syntax used here: 20 boost::regex e1(my_expression); 21 // e2 a case insensitive Perl regular expression: 22 boost::regex e2(my_expression, boost::regex::perl|boost::regex::icase); 23 24[h3 Perl Regular Expression Syntax] 25 26In Perl regular expressions, all characters match themselves except for the 27following special characters: 28 29[pre .\[{}()\\\*+?|^$] 30 31Other characters are special only in certain situations - for example `]` is special only after an opening `[`. 32 33[h4 Wildcard] 34 35The single character '.' when used outside of a character set will match 36any single character except: 37 38* The NULL character when the [link boost_regex.ref.match_flag_type flag 39 [^match_not_dot_null]] is passed to the matching algorithms. 40* The newline character when the [link boost_regex.ref.match_flag_type 41 flag [^match_not_dot_newline]] is passed to 42 the matching algorithms. 43 44[h4 Anchors] 45 46A '^' character shall match the start of a line. 47 48A '$' character shall match the end of a line. 49 50[h4 Marked sub-expressions] 51 52A section beginning [^(] and ending [^)] acts as a marked sub-expression. 53Whatever matched the sub-expression is split out in a separate field by 54the matching algorithms. Marked sub-expressions can also repeated, or 55referred to by a back-reference. 56 57[h4 Non-marking grouping] 58 59A marked sub-expression is useful to lexically group part of a regular 60expression, but has the side-effect of spitting out an extra field in 61the result. As an alternative you can lexically group part of a 62regular expression, without generating a marked sub-expression by using 63[^(?:] and [^)] , for example [^(?:ab)+] will repeat [^ab] without splitting 64out any separate sub-expressions. 65 66[h4 Repeats] 67 68Any atom (a single character, a marked sub-expression, or a character class) 69can be repeated with the [^*], [^+], [^?], and [^{}] operators. 70 71The [^*] operator will match the preceding atom zero or more times, 72for example the expression [^a*b] will match any of the following: 73 74 b 75 ab 76 aaaaaaaab 77 78The [^+] operator will match the preceding atom one or more times, for 79example the expression [^a+b] will match any of the following: 80 81 ab 82 aaaaaaaab 83 84But will not match: 85 86 b 87 88The [^?] operator will match the preceding atom zero or one times, for 89example the expression ca?b will match any of the following: 90 91 cb 92 cab 93 94But will not match: 95 96 caab 97 98An atom can also be repeated with a bounded repeat: 99 100[^a{n}] Matches 'a' repeated exactly n times. 101 102[^a{n,}] Matches 'a' repeated n or more times. 103 104[^a{n, m}] Matches 'a' repeated between n and m times inclusive. 105 106For example: 107 108[pre ^a{2,3}$] 109 110Will match either of: 111 112 aa 113 aaa 114 115But neither of: 116 117 a 118 aaaa 119 120Note that the "{" and "}" characters will treated as ordinary literals when used 121in a context that is not a repeat: this matches Perl 5.x behavior. For example in 122the expressions "ab{1", "ab1}" and "a{b}c" the curly brackets are all treated as 123literals and ['no error will be raised]. 124 125It is an error to use a repeat operator, if the preceding construct can not 126be repeated, for example: 127 128 a(*) 129 130Will raise an error, as there is nothing for the [^*] operator to be applied to. 131 132[h4 Non greedy repeats] 133 134The normal repeat operators are "greedy", that is to say they will consume as 135much input as possible. There are non-greedy versions available that will 136consume as little input as possible while still producing a match. 137 138[^*?] Matches the previous atom zero or more times, while consuming as little 139 input as possible. 140 141[^+?] Matches the previous atom one or more times, while consuming as 142 little input as possible. 143 144[^??] Matches the previous atom zero or one times, while consuming 145 as little input as possible. 146 147[^{n,}?] Matches the previous atom n or more times, while consuming as 148 little input as possible. 149 150[^{n,m}?] Matches the previous atom between n and m times, while 151 consuming as little input as possible. 152 153[h4 Possessive repeats] 154 155By default when a repeated pattern does not match then the engine will backtrack until 156a match is found. However, this behaviour can sometime be undesireble so there are 157also "possessive" repeats: these match as much as possible and do not then allow 158backtracking if the rest of the expression fails to match. 159 160[^*+] Matches the previous atom zero or more times, while giving nothing back. 161 162[^++] Matches the previous atom one or more times, while giving nothing back. 163 164[^?+] Matches the previous atom zero or one times, while giving nothing back. 165 166[^{n,}+] Matches the previous atom n or more times, while giving nothing back. 167 168[^{n,m}+] Matches the previous atom between n and m times, while giving nothing back. 169 170[h4 Back references] 171 172An escape character followed by a digit /n/, where /n/ is in the range 1-9, 173matches the same string that was matched by sub-expression /n/. For example 174the expression: 175 176[pre ^(a\*)\[\^a\]\*\\1$] 177 178Will match the string: 179 180 aaabbaaa 181 182But not the string: 183 184 aaabba 185 186You can also use the \g escape for the same function, for example: 187 188[table 189[[Escape][Meaning]] 190[[[^\g1]][Match whatever matched sub-expression 1]] 191[[[^\g{1}]][Match whatever matched sub-expression 1: this form allows for safer 192 parsing of the expression in cases like [^\g{1}2] or for indexes higher than 9 as in [^\g{1234}]]] 193[[[^\g-1]][Match whatever matched the last opened sub-expression]] 194[[[^\g{-2}]][Match whatever matched the last but one opened sub-expression]] 195[[[^\g{one}]][Match whatever matched the sub-expression named "one"]] 196] 197 198Finally the \k escape can be used to refer to named subexpressions, for example [^\k<two>] will match 199whatever matched the subexpression named "two". 200 201[h4 Alternation] 202 203The [^|] operator will match either of its arguments, so for example: 204[^abc|def] will match either "abc" or "def". 205 206Parenthesis can be used to group alternations, for example: [^ab(d|ef)] 207will match either of "abd" or "abef". 208 209Empty alternatives are not allowed (these are almost always a mistake), but 210if you really want an empty alternative use [^(?:)] as a placeholder, for example: 211 212[^|abc] is not a valid expression, but 213 214[^(?:)|abc] is and is equivalent, also the expression: 215 216[^(?:abc)??] has exactly the same effect. 217 218[h4 Character sets] 219 220A character set is a bracket-expression starting with [^[] and ending with [^]], 221it defines a set of characters, and matches any single character that is a 222member of that set. 223 224A bracket expression may contain any combination of the following: 225 226[h5 Single characters] 227 228For example [^\[abc\]], will match any of the characters 'a', 'b', or 'c'. 229 230[h5 Character ranges] 231 232For example [^\[a-c\]] will match any single character in the range 'a' to 'c'. 233By default, for Perl regular expressions, a character x is within the 234range y to z, if the code point of the character lies within the codepoints of 235the endpoints of the range. Alternatively, if you set the 236[link boost_regex.ref.syntax_option_type.syntax_option_type_perl [^collate] flag] 237when constructing the regular expression, then ranges are locale sensitive. 238 239[h5 Negation] 240 241If the bracket-expression begins with the ^ character, then it matches the 242complement of the characters it contains, for example [^\[^a-c\]] matches 243any character that is not in the range [^a-c]. 244 245[h5 Character classes] 246 247An expression of the form [^\[\[:name:\]\]] matches the named character class 248"name", for example [^\[\[:lower:\]\]] matches any lower case character. 249See [link boost_regex.syntax.character_classes character class names]. 250 251[h5 Collating Elements] 252 253An expression of the form [^\[\[.col.\]\]] matches the collating element /col/. 254A collating element is any single character, or any sequence of characters 255that collates as a single unit. Collating elements may also be used 256as the end point of a range, for example: [^\[\[.ae.\]-c\]] matches the 257character sequence "ae", plus any single character in the range "ae"-c, 258assuming that "ae" is treated as a single collating element in the current locale. 259 260As an extension, a collating element may also be specified via it's 261[link boost_regex.syntax.collating_names symbolic name], for example: 262 263 [[.NUL.]] 264 265matches a [^\0] character. 266 267[h5 Equivalence classes] 268 269An expression of the form [^\[\[\=col\=\]\]], matches any character or collating element 270whose primary sort key is the same as that for collating element /col/, as with 271collating elements the name /col/ may be a 272[link boost_regex.syntax.collating_names symbolic name]. A primary sort key is 273one that ignores case, accentation, or locale-specific tailorings; so for 274example `[[=a=]]` matches any of the characters: 275a, '''À''', '''Á''', '''Â''', 276'''Ã''', '''Ä''', '''Å''', A, '''à''', '''á''', 277'''â''', '''ã''', '''ä''' and '''å'''. 278Unfortunately implementation of this is reliant on the platform's collation 279and localisation support; this feature can not be relied upon to work portably 280across all platforms, or even all locales on one platform. 281 282[h5 Escaped Characters] 283 284All the escape sequences that match a single character, or a single character 285class are permitted within a character class definition. For example 286`[\[\]]` would match either of `[` or `]` while `[\W\d]` would match any character 287that is either a "digit", /or/ is /not/ a "word" character. 288 289[h5 Combinations] 290 291All of the above can be combined in one character set declaration, for example: 292[^\[\[:digit:\]a-c\[.NUL.\]\]]. 293 294[h4 Escapes] 295 296Any special character preceded by an escape shall match itself. 297 298The following escape sequences are all synonyms for single characters: 299 300[table 301[[Escape][Character]] 302[[[^\\a]][[^\\a]]] 303[[[^\\e]][[^0x1B]]] 304[[[^\\f]][[^\\f]]] 305[[[^\\n]][[^\\n]]] 306[[[^\\r]][[^\\r]]] 307[[[^\\t]][[^\\t]]] 308[[[^\\v]][[^\\v]]] 309[[[^\\b]][[^\\b] (but only inside a character class declaration).]] 310[[[^\\cX]][An ASCII escape sequence - the character whose code point is X % 32]] 311[[[^\\xdd]][A hexadecimal escape sequence - matches the single character whose 312 code point is 0xdd.]] 313[[[^\\x{dddd}]][A hexadecimal escape sequence - matches the single character whose 314 code point is 0xdddd.]] 315[[[^\\0ddd]][An octal escape sequence - matches the single character whose 316 code point is 0ddd.]] 317[[[^\\N{name}]][Matches the single character which has the 318 [link boost_regex.syntax.collating_names symbolic name] /name/. 319 For example [^\\N{newline}] matches the single character \\n.]] 320] 321 322[h5 "Single character" character classes:] 323 324Any escaped character /x/, if /x/ is the name of a character class shall 325match any character that is a member of that class, and any 326escaped character /X/, if /x/ is the name of a character class, shall 327match any character not in that class. 328 329The following are supported by default: 330 331[table 332[[Escape sequence][Equivalent to]] 333[[`\d`][`[[:digit:]]`]] 334[[`\l`][`[[:lower:]]`]] 335[[`\s`][`[[:space:]]`]] 336[[`\u`][`[[:upper:]]`]] 337[[`\w`][`[[:word:]]`]] 338[[`\h`][Horizontal whitespace]] 339[[`\v`][Vertical whitespace]] 340[[`\D`][`[^[:digit:]]`]] 341[[`\L`][`[^[:lower:]]`]] 342[[`\S`][`[^[:space:]]`]] 343[[`\U`][`[^[:upper:]]`]] 344[[`\W`][`[^[:word:]]`]] 345[[`\H`][Not Horizontal whitespace]] 346[[`\V`][Not Vertical whitespace]] 347] 348 349[h5 Character Properties] 350 351The character property names in the following table are all equivalent 352to the [link boost_regex.syntax.character_classes names used in character classes]. 353 354[table 355[[Form][Description][Equivalent character set form]] 356[[`\pX`][Matches any character that has the property X.][`[[:X:]]`]] 357[[`\p{Name}`][Matches any character that has the property Name.][`[[:Name:]]`]] 358[[`\PX`][Matches any character that does not have the property X.][`[^[:X:]]`]] 359[[`\P{Name}`][Matches any character that does not have the property Name.][`[^[:Name:]]`]] 360] 361 362For example [^\pd] matches any "digit" character, as does [^\p{digit}]. 363 364[h5 Word Boundaries] 365 366The following escape sequences match the boundaries of words: 367 368[^\<] Matches the start of a word. 369 370[^\>] Matches the end of a word. 371 372[^\b] Matches a word boundary (the start or end of a word). 373 374[^\B] Matches only when not at a word boundary. 375 376[h5 Buffer boundaries] 377 378The following match only at buffer boundaries: a "buffer" in this 379context is the whole of the input text that is being matched against 380(note that ^ and $ may match embedded newlines within the text). 381 382\\\` Matches at the start of a buffer only. 383 384\\' Matches at the end of a buffer only. 385 386\\A Matches at the start of a buffer only (the same as [^\\\`]). 387 388\\z Matches at the end of a buffer only (the same as [^\\']). 389 390\\Z Matches a zero-width assertion consisting of an optional sequence of newlines at the end of a buffer: 391equivalent to the regular expression [^(?=\\v*\\z)]. Note that this is subtly different from Perl which 392behaves as if matching [^(?=\\n?\\z)]. 393 394[h5 Continuation Escape] 395 396The sequence [^\G] matches only at the end of the last match found, or at 397the start of the text being matched if no previous match was found. 398This escape useful if you're iterating over the matches contained within a 399text, and you want each subsequence match to start where the last one ended. 400 401[h5 Quoting escape] 402 403The escape sequence [^\Q] begins a "quoted sequence": all the subsequent characters 404are treated as literals, until either the end of the regular expression or \\E 405is found. For example the expression: [^\Q\*+\Ea+] would match either of: 406 407 \*+a 408 \*+aaa 409 410[h5 Unicode escapes] 411 412[^\C] Matches a single code point: in Boost regex this has exactly the 413 same effect as a "." operator. 414[^\X] Matches a combining character sequence: that is any non-combining 415 character followed by a sequence of zero or more combining characters. 416 417[h5 Matching Line Endings] 418 419The escape sequence [^\R] matches any line ending character sequence, specifically it is identical to 420the expression [^(?>\x0D\x0A?|\[\x0A-\x0C\x85\x{2028}\x{2029}\])]. 421 422[h5 Keeping back some text] 423 424[^\K] Resets the start location of $0 to the current text position: in other words everything to the 425left of \K is "kept back" and does not form part of the regular expression match. $` is updated 426accordingly. 427 428For example [^foo\Kbar] matched against the text "foobar" would return the match "bar" for $0 and "foo" 429for $`. This can be used to simulate variable width lookbehind assertions. 430 431[h5 Any other escape] 432 433Any other escape sequence matches the character that is escaped, for example 434\\@ matches a literal '@'. 435 436[h4 Perl Extended Patterns] 437 438Perl-specific extensions to the regular expression syntax all start with [^(?]. 439 440[h5 Named Subexpressions] 441 442You can create a named subexpression using: 443 444 (?<NAME>expression) 445 446Which can be then be referred to by the name /NAME/. Alternatively you can delimit the name 447using 'NAME' as in: 448 449 (?'NAME'expression) 450 451These named subexpressions can be referred to in a backreference using either [^\g{NAME}] or [^\k<NAME>] 452and can also be referred to by name in a [perl_format] format string for search and replace operations, or in the 453[match_results] member functions. 454 455[h5 Comments] 456 457[^(?# ... )] is treated as a comment, it's contents are ignored. 458 459[h5 Modifiers] 460 461[^(?imsx-imsx ... )] alters which of the perl modifiers are in effect within 462the pattern, changes take effect from the point that the block is first seen 463and extend to any enclosing [^)]. Letters before a '-' turn that perl 464modifier on, letters afterward, turn it off. 465 466[^(?imsx-imsx:pattern)] applies the specified modifiers to pattern only. 467 468[h5 Non-marking groups] 469 470[^(?:pattern)] lexically groups pattern, without generating an additional 471sub-expression. 472 473[h5 Branch reset] 474 475[^(?|pattern)] resets the subexpression count at the start of each "|" alternative within /pattern/. 476 477The sub-expression count following this construct is that of whichever branch had the largest number of 478sub-expressions. This construct is useful when you want to capture one of a number of alternative matches 479in a single sub-expression index. 480 481In the following example the index of each sub-expression is shown below the expression: 482 483[pre 484# before ---------------branch-reset----------- after 485/ ( a ) (?| x ( y ) z | (p (q) r) | (t) u (v) ) ( z ) /x 486# 1 2 2 3 2 3 4 487] 488 489[h5 Lookahead] 490 491[^(?=pattern)] consumes zero characters, only if pattern matches. 492 493[^(?!pattern)] consumes zero characters, only if pattern does not match. 494 495Lookahead is typically used to create the logical AND of two regular 496expressions, for example if a password must contain a lower case letter, 497an upper case letter, a punctuation symbol, and be at least 6 characters long, 498then the expression: 499 500 (?=.*[[:lower:]])(?=.*[[:upper:]])(?=.*[[:punct:]]).{6,} 501 502could be used to validate the password. 503 504[h5 Lookbehind] 505 506[^(?<=pattern)] consumes zero characters, only if pattern could be matched 507against the characters preceding the current position (pattern must be 508of fixed length). 509 510[^(?<!pattern)] consumes zero characters, only if pattern could not be 511matched against the characters preceding the current position (pattern must 512be of fixed length). 513 514[h5 Independent sub-expressions] 515 516[^(?>pattern)] /pattern/ is matched independently of the surrounding patterns, 517the expression will never backtrack into /pattern/. Independent sub-expressions 518are typically used to improve performance; only the best possible match 519for pattern will be considered, if this doesn't allow the expression as a 520whole to match then no match is found at all. 521 522[h5 Recursive Expressions] 523 524[^(?['N]) (?-['N]) (?+['N]) (?R) (?0) (?&NAME)] 525 526[^(?R)] and [^(?0)] recurse to the start of the entire pattern. 527 528[^(?['N])] executes sub-expression /N/ recursively, for example [^(?2)] will recurse to sub-expression 2. 529 530[^(?-['N])] and [^(?+['N])] are relative recursions, so for example [^(?-1)] recurses to the last sub-expression to be declared, 531and [^(?+1)] recurses to the next sub-expression to be declared. 532 533[^(?&NAME)] recurses to named sub-expression ['NAME]. 534 535[h5 Conditional Expressions] 536 537[^(?(condition)yes-pattern|no-pattern)] attempts to match /yes-pattern/ if 538the /condition/ is true, otherwise attempts to match /no-pattern/. 539 540[^(?(condition)yes-pattern)] attempts to match /yes-pattern/ if the /condition/ 541is true, otherwise matches the NULL string. 542 543/condition/ may be either: a forward lookahead assert, the index of 544a marked sub-expression (the condition becomes true if the sub-expression 545has been matched), or an index of a recursion (the condition become true if we are executing 546directly inside the specified recursion). 547 548Here is a summary of the possible predicates: 549 550* [^(?(?\=assert)yes-pattern|no-pattern)] Executes /yes-pattern/ if the forward look-ahead assert matches, otherwise 551executes /no-pattern/. 552* [^(?(?!assert)yes-pattern|no-pattern)] Executes /yes-pattern/ if the forward look-ahead assert does not match, otherwise 553executes /no-pattern/. 554* [^(?(['N])yes-pattern|no-pattern)] Executes /yes-pattern/ if subexpression /N/ has been matched, otherwise 555executes /no-pattern/. 556* [^(?(<['name]>)yes-pattern|no-pattern)] Executes /yes-pattern/ if named subexpression /name/ has been matched, otherwise 557executes /no-pattern/. 558* [^(?('['name]')yes-pattern|no-pattern)] Executes /yes-pattern/ if named subexpression /name/ has been matched, otherwise 559executes /no-pattern/. 560* [^(?(R)yes-pattern|no-pattern)] Executes /yes-pattern/ if we are executing inside a recursion, otherwise 561executes /no-pattern/. 562* [^(?(R['N])yes-pattern|no-pattern)] Executes /yes-pattern/ if we are executing inside a recursion to sub-expression /N/, otherwise 563executes /no-pattern/. 564* [^(?(R&['name])yes-pattern|no-pattern)] Executes /yes-pattern/ if we are executing inside a recursion to named sub-expression /name/, otherwise 565executes /no-pattern/. 566* [^(?(DEFINE)never-exectuted-pattern)] Defines a block of code that is never executed and matches no characters: 567this is usually used to define one or more named sub-expressions which are referred to from elsewhere in the pattern. 568 569[h5 Backtracking Control Verbs] 570 571This library has partial support for Perl's backtracking control verbs, in particular (*MARK) is not supported. 572There may also be detail differences in behaviour between this library and Perl, not least because Perl's behaviour 573is rather under-documented and often somewhat random in how it behaves in practice. The verbs supported are: 574 575* [^(*PRUNE)] Has no effect unless backtracked onto, in which case all the backtracking information prior to this 576point is discarded. 577* [^(*SKIP)] Behaves the same as [^(*PRUNE)] except that it is assumed that no match can possibly occur prior to 578the current point in the string being searched. This can be used to optimize searches by skipping over chunks of text 579that have already been determined can not form a match. 580* [^(*THEN)] Has no effect unless backtracked onto, in which case all subsequent alternatives in a group of alternations 581are discarded. 582* [^(*COMMIT)] Has no effect unless backtracked onto, in which case all subsequent matching/searching attempts are abandoned. 583* [^(*FAIL)] Causes the match to fail unconditionally at this point, can be used to force the engine to backtrack. 584* [^(*ACCEPT)] Causes the pattern to be considered matched at the current point. Any half-open sub-expressions are closed at the current point. 585 586[h4 Operator precedence] 587 588The order of precedence for of operators is as follows: 589 590# Collation-related bracket symbols `[==] [::] [..]` 591# Escaped characters [^\\] 592# Character set (bracket expression) `[]` 593# Grouping [^()] 594# Single-character-ERE duplication [^* + ? {m,n}] 595# Concatenation 596# Anchoring ^$ 597# Alternation | 598 599[h3 What gets matched] 600 601If you view the regular expression as a directed (possibly cyclic) 602graph, then the best match found is the first match found by a 603depth-first-search performed on that graph, while matching the input text. 604 605Alternatively: 606 607The best match found is the 608[link boost_regex.syntax.leftmost_longest_rule leftmost match], 609with individual elements matched as follows; 610 611[table 612[[Construct][What gets matched]] 613[[[^AtomA AtomB]][Locates the best match for /AtomA/ that has a following match for /AtomB/.]] 614[[[^Expression1 | Expression2]][If /Expresion1/ can be matched then returns that match, 615 otherwise attempts to match /Expression2/.]] 616[[[^S{N}]][Matches /S/ repeated exactly N times.]] 617[[[^S{N,M}]][Matches S repeated between N and M times, and as many times as possible.]] 618[[[^S{N,M}?]][Matches S repeated between N and M times, and as few times as possible.]] 619[[[^S?, S*, S+]][The same as [^S{0,1}], [^S{0,UINT_MAX}], [^S{1,UINT_MAX}] respectively.]] 620[[[^S??, S*?, S+?]][The same as [^S{0,1}?], [^S{0,UINT_MAX}?], [^S{1,UINT_MAX}?] respectively.]] 621[[[^(?>S)]][Matches the best match for /S/, and only that.]] 622[[[^(?=S), (?<=S)]][Matches only the best match for /S/ (this is only 623 visible if there are capturing parenthesis within /S/).]] 624[[[^(?!S), (?<!S)]][Considers only whether a match for S exists or not.]] 625[[[^(?(condition)yes-pattern | no-pattern)]][If condition is true, then 626 only yes-pattern is considered, otherwise only no-pattern is considered.]] 627] 628 629[h3 Variations] 630 631The [link boost_regex.ref.syntax_option_type.syntax_option_type_perl options [^normal], 632[^ECMAScript], [^JavaScript] and [^JScript]] are all synonyms for 633[^perl]. 634 635[h3 Options] 636 637There are a [link boost_regex.ref.syntax_option_type.syntax_option_type_perl 638variety of flags] that may be combined with the [^perl] option when 639constructing the regular expression, in particular note that the 640[^newline_alt] option alters the syntax, while the [^collate], [^nosubs] and 641[^icase] options modify how the case and locale sensitivity are to be applied. 642 643[h3 Pattern Modifiers] 644 645The perl [^smix] modifiers can either be applied using a [^(?smix-smix)] 646prefix to the regular expression, or with one of the 647[link boost_regex.ref.syntax_option_type.syntax_option_type_perl regex-compile time 648flags [^no_mod_m], [^mod_x], [^mod_s], and [^no_mod_s]]. 649 650[h3 References] 651 652[@http://perldoc.perl.org/perlre.html Perl 5.8]. 653 654 655[endsect] 656 657 658