{"id":24468,"date":"2024-02-15T14:53:34","date_gmt":"2024-02-15T22:53:34","guid":{"rendered":"https:\/\/docs.extraview.com\/v25\/book\/regular-expressions-1\/"},"modified":"2025-02-24T09:17:01","modified_gmt":"2025-02-24T17:17:01","slug":"regular-expressions-1","status":"publish","type":"page","link":"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/regular-expressions-1\/","title":{"rendered":"Regular Expressions"},"content":{"rendered":"<h3>\n\tSummary of regular-expression constructs<\/h3>\n<table class=\"border\">\n<tbody>\n<tr class=\"tableHeaderRow\">\n<td>\n\t\t\t\tConstruct<\/td>\n<td>\n\t\t\t\tMatches<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t&nbsp;<\/td>\n<td bgcolor=\"#e1c194\">\n\t\t\t\tCharacters<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tx<\/td>\n<td>\n\t\t\t\tThe character x<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t\\|<\/td>\n<td>\n\t\t\t\tThe backslash character<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t\\n<\/td>\n<td>\n\t\t\t\tThe character with octal value 0n (0 &lt;= n &lt;= 7)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t\\nn<\/td>\n<td>\n\t\t\t\tThe character with octal value 0nn (0 &lt;= n &lt;= 7)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t\\mnn<\/td>\n<td>\n\t\t\t\tThe character with octal value 0mnn (0 &lt;= m &lt;= 3, 0 &lt;= n &lt;= 7)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\txhh<\/td>\n<td>\n\t\t\t\tThe character with hexadecimal value 0xhh<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tuhhhh<\/td>\n<td>\n\t\t\t\tThe character with hexadecimal value 0xhhhh<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tt<\/td>\n<td>\n\t\t\t\tThe tab character (&#8216;u0009&#8217;)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tn<\/td>\n<td>\n\t\t\t\tThe newline (line feed) character (&#8216;u000A&#8217;)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tr<\/td>\n<td>\n\t\t\t\tThe carriage-return character (&#8216;u000D&#8217;)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tf<\/td>\n<td>\n\t\t\t\tThe form-feed character (&#8216;u000C&#8217;)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\ta<\/td>\n<td>\n\t\t\t\tThe alert (bell) character (&#8216;u0007&#8217;)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\te<\/td>\n<td>\n\t\t\t\tThe escape character (&#8216;u001B&#8217;)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tcx<\/td>\n<td>\n\t\t\t\tThe control character corresponding to x<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t&nbsp;<\/td>\n<td bgcolor=\"#e1c194\">\n\t\t\t\tCharacter classes<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t[abc]<\/td>\n<td>\n\t\t\t\ta, b, or c (simple class)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t[^abc]<\/td>\n<td>\n\t\t\t\tAny character except a, b, or c (negation)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t[a-zA-Z]<\/td>\n<td>\n\t\t\t\ta through z or A through Z, inclusive (range)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t[a-d[m-p]]<\/td>\n<td>\n\t\t\t\ta through d, or m through p: [a-dm-p] (union)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t[a-z&amp;&amp;[def]]<\/td>\n<td>\n\t\t\t\td, e, or f (intersection)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t[a-z&amp;&amp;[^bc]]<\/td>\n<td>\n\t\t\t\ta through z, except for b and c: [ad-z] (subtraction)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t[a-z&amp;&amp;[^m-p]]<\/td>\n<td>\n\t\t\t\ta through z, and not m through p: [a-lq-z](subtraction)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t&nbsp;<\/td>\n<td bgcolor=\"#e1c194\">\n\t\t\t\tPredefined character classes<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t.<\/td>\n<td>\n\t\t\t\tAny character (may or may not match line terminators)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\td<\/td>\n<td>\n\t\t\t\tA digit: [0-9]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tD<\/td>\n<td>\n\t\t\t\tA non-digit: [^0-9]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\ts<\/td>\n<td>\n\t\t\t\tA whitespace character: [ tnx0Bfr]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tS<\/td>\n<td>\n\t\t\t\tA non-whitespace character: [^s]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tw<\/td>\n<td>\n\t\t\t\tA word character: [a-zA-Z_0-9]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tW<\/td>\n<td>\n\t\t\t\tA non-word character: [^w]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t&nbsp;<\/td>\n<td bgcolor=\"#e1c194\">\n\t\t\t\tPOSIX character classes (US-ASCII only)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{Lower}<\/td>\n<td>\n\t\t\t\tA lower-case alphabetic character: [a-z]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{Upper}<\/td>\n<td>\n\t\t\t\tAn upper-case alphabetic character:[A-Z]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{ASCII}<\/td>\n<td>\n\t\t\t\tAll ASCII:[x00-x7F]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{Alpha}<\/td>\n<td>\n\t\t\t\tAn alphabetic character:[p{Lower}p{Upper}]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{Digit}<\/td>\n<td>\n\t\t\t\tA decimal digit: [0-9]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{Alnum}<\/td>\n<td>\n\t\t\t\tAn alphanumeric character:[p{Alpha}p{Digit}]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{Punct}<\/td>\n<td>\n\t\t\t\tPunctuation: One of !&#8221;#$%&amp;'()*+,-.\/:;&lt;=&gt;?@[]^_`{|}~<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{Graph}<\/td>\n<td>\n\t\t\t\tA visible character: [p{Alnum}p{Punct}]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{Print}<\/td>\n<td>\n\t\t\t\tA printable character: [p{Graph}]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{Blank}<\/td>\n<td>\n\t\t\t\tA space or a tab: [ t]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{Cntrl}<\/td>\n<td>\n\t\t\t\tA control character: [x00-x1Fx7F]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{XDigit}<\/td>\n<td>\n\t\t\t\tA hexadecimal digit: [0-9a-fA-F]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{Space}<\/td>\n<td>\n\t\t\t\tA whitespace character: [ tnx0Bfr]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t&nbsp;<\/td>\n<td bgcolor=\"#e1c194\">\n\t\t\t\tClasses for Unicode blocks and categories<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{InGreek}<\/td>\n<td>\n\t\t\t\tA character in the Greek block (simple block)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{Lu}<\/td>\n<td>\n\t\t\t\tAn uppercase letter (simple category)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tp{Sc}<\/td>\n<td>\n\t\t\t\tA currency symbol<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tP{InGreek}<\/td>\n<td>\n\t\t\t\tAny character except one in the Greek block (negation)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t[p{L}&amp;&amp;[^p{Lu}]]<\/td>\n<td>\n\t\t\t\tAny letter except an uppercase letter (subtraction)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t&nbsp;<\/td>\n<td bgcolor=\"#e1c194\">\n\t\t\t\tBoundary matchers<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t^<\/td>\n<td>\n\t\t\t\tThe beginning of a line<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t$<\/td>\n<td>\n\t\t\t\tThe end of a line<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tb<\/td>\n<td>\n\t\t\t\tA word boundary<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tB<\/td>\n<td>\n\t\t\t\tA non-word boundary<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tA<\/td>\n<td>\n\t\t\t\tThe beginning of the input<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tG<\/td>\n<td>\n\t\t\t\tThe end of the previous match<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tZ<\/td>\n<td>\n\t\t\t\tThe end of the input but for the final terminator, if any<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tz<\/td>\n<td>\n\t\t\t\tThe end of the input<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t&nbsp;<\/td>\n<td bgcolor=\"#e1c194\">\n\t\t\t\tGreedy quantifiers<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX?<\/td>\n<td>\n\t\t\t\tX, once or not at all<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX*<\/td>\n<td>\n\t\t\t\tX, zero or more times<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX+<\/td>\n<td>\n\t\t\t\tX, one or more times<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX{n}<\/td>\n<td>\n\t\t\t\tX, exactly n times<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX(n,}<\/td>\n<td>\n\t\t\t\tX, at least n times<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX{n,m}<\/td>\n<td>\n\t\t\t\tX, at least n but not more than m times<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t&nbsp;<\/td>\n<td bgcolor=\"#e1c194\">\n\t\t\t\tReluctant quantifiers<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX??<\/td>\n<td>\n\t\t\t\tX, once or not at all<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX*?<\/td>\n<td>\n\t\t\t\tX, zero or more times<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX+?<\/td>\n<td>\n\t\t\t\tX, one or more times<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX{n}?<\/td>\n<td>\n\t\t\t\tX, exactly n times<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX(n,}?<\/td>\n<td>\n\t\t\t\tX, at least n times<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX{n,m}?<\/td>\n<td>\n\t\t\t\tX, at least n but not more than m times<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t&nbsp;<\/td>\n<td bgcolor=\"#e1c194\">\n\t\t\t\tPossessive quantifiers<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX?+<\/td>\n<td>\n\t\t\t\tX, once or not at all<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX*+<\/td>\n<td>\n\t\t\t\tX, zero or more times<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX++<\/td>\n<td>\n\t\t\t\tX, one or more times<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX{n}+<\/td>\n<td>\n\t\t\t\tX, exactly n times<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX(n,}+<\/td>\n<td>\n\t\t\t\tX, at least n times<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX{n,m}+<\/td>\n<td>\n\t\t\t\tX, at least n but not more than m times<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t&nbsp;<\/td>\n<td bgcolor=\"#e1c194\">\n\t\t\t\tLogical operators<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tXY<\/td>\n<td>\n\t\t\t\tX followed by Y<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tX|Y<\/td>\n<td>\n\t\t\t\tEither X or Y<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t(X)<\/td>\n<td>\n\t\t\t\tX, as a capturing group<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t&nbsp;<\/td>\n<td>\n\t\t\t\tBack references<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tn<\/td>\n<td>\n\t\t\t\tWhatever the nth capturing group matched<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t&nbsp;<\/td>\n<td bgcolor=\"#e1c194\">\n\t\t\t\tQuotation<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t&nbsp;<\/td>\n<td>\n\t\t\t\tNothing, but quotes the following character<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tQ<\/td>\n<td>\n\t\t\t\tNothing, but quotes all characters until E<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tE<\/td>\n<td>\n\t\t\t\tNothing, but ends quoting started by Q<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t&nbsp;<\/td>\n<td bgcolor=\"#e1c194\">\n\t\t\t\tSpecial constructs (non-capturing)<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t(?:X)<\/td>\n<td>\n\t\t\t\tX, as a non-capturing group<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t(?idmsux-idmsux)<\/td>\n<td>\n\t\t\t\tNothing, but turns match flags on &#8211; off<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t(?idmsux-idmsux:X)<\/td>\n<td>\n\t\t\t\tX, as a non-capturing group with the given flags on &#8211; off<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t(?=X)<\/td>\n<td>\n\t\t\t\tX, via zero-width positive lookahead<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t(?!X)<\/td>\n<td>\n\t\t\t\tX, via zero-width negative lookahead<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t(?&lt;=X)<\/td>\n<td>\n\t\t\t\tX, via zero-width positive lookbehind<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t(?<!--X)<\/td--><\/td>\n<td>\n\t\t\t\tX, via zero-width negative lookbehind<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t(?&gt;X)<\/td>\n<td>\n\t\t\t\tX, as an independent, non-capturing group<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\n\tBackslashes, escapes, and quoting<\/h3>\n<p>The backslash character (&#8221;) serves to introduce escaped constructs, as defined in the table above, as well as to quote characters that otherwise would be interpreted as unescaped constructs. Thus the expression matches a single backslash and { matches a left brace. It is an error to use a backslash prior to any alphabetic character that does not denote an escaped construct; these are reserved for future extensions to the regular-expression language.<\/p>\n<p>A backslash may be used prior to a non-alphabetic character regardless of whether that character is part of an unescaped construct. Backslashes within string literals in Java source code are interpreted as required by the Java Language Specification as either Unicode escapes or other character escapes. It is therefore necessary to double backslashes in string literals that represent regular expressions to protect them from interpretation by the Java bytecode compiler. The string literal &#8220;b&#8221;, for example, matches a single backspace character when interpreted as a regular expression, while &#8220;b&#8221; matches a word boundary. The string literal &#8220;(hello)&#8221; is illegal and leads to a compile-time error; in order to match the string (hello) the string literal &#8220;(hello)&#8221; must be used.<\/p>\n<h3>\n\tLine terminators<\/h3>\n<p>A line terminator is a one- or two-character sequence that marks the end of a line of the input character sequence. The following are recognized as line terminators:<\/p>\n<ul>\n<li>\n\t\tA newline (line feed) character (&#8216;n&#8217;)<\/li>\n<li>\n\t\tA carriage-return character followed immediately by a newline character (&#8220;rn&#8221;)<\/li>\n<li>\n\t\tA standalone carriage-return character (&#8216;r&#8217;)<\/li>\n<li>\n\t\tA next-line character (&#8216;u0085&#8217;)<\/li>\n<li>\n\t\tA line-separator character (&#8216;u2028&#8217;)<\/li>\n<li>\n\t\tA paragraph-separator character (&#8216;u2029).<\/li>\n<\/ul>\n<p>If UNIX_LINES mode is activated, then the only line terminators recognized are newline characters. The regular expression . matches any character except a line terminator unless the DOTALL flag is specified.<\/p>\n<h3>\n\tGroups and capturing<\/h3>\n<p>Capturing groups are numbered by counting their opening parentheses from left to right. In the expression ((A)(B(C))), for example, there are four such groups:<\/p>\n<ol>\n<li>\n\t\t((A)(B(C)))<\/li>\n<li>\n\t\t(A)<\/li>\n<li>\n\t\t(B(C))<\/li>\n<li>\n\t\t(C)<\/li>\n<\/ol>\n<p>Group zero always stands for the entire expression. Capturing groups are so named because, during a match, each subsequence of the input sequence that matches such a group is saved. The captured subsequence may be used later in the expression, via a back reference, and may also be retrieved from the matcher once the match operation is complete. The captured input associated with a group is always the subsequence that the group most recently matched. If a group is evaluated a second time because of quantification then its previously-captured value, if any, will be retained if the second evaluation fails. Matching the string &#8220;aba&#8221; against the expression (a(b)?)+, for example, leaves group two set to &#8220;b&#8221;. All captured input is discarded at the beginning of each match. Groups beginning with (? are pure, non-capturing groups that do not capture text and do not count towards the group total.<\/p>\n<h3>\n\tUnicode support<\/h3>\n<p>This class follows Unicode Technical Report #18: Unicode Regular Expression Guidelines, implementing its second level of support though with a slightly different concrete syntax. Unicode escape sequences such as u2014 in Java source code are processed as described in \u00a73.3 of the Java Language Specification. Such escape sequences are also implemented directly by the regular-expression parser so that Unicode escapes can be used in expressions that are read from files or from the keyboard. Thus the strings &#8220;u2014&#8221; and &#8220;u2014&#8221;, while not equal, compile into the same pattern, which matches the character with hexadecimal value 0x2014. Unicode blocks and categories are written with the p and P constructs as in Perl. p{prop} matches if the input has the property prop, while P{{prop} does not match if the input has that property. Blocks are specified with the prefix In, as in InMongolian.<\/p>\n<p>Categories may be specified with the optional prefix Is: Both p{L} and p{IsL} denote the category of Unicode letters. Blocks and categories can be used both inside and outside of a character class. The supported blocks and categories are those of The Unicode Standard, Version 3.0. The block names are those defined in Chapter 14 and in the file Blocks-3.txt of the Unicode Character Database except that the spaces are removed; &#8220;Basic Latin&#8221;, for example, becomes &#8220;BasicLatin&#8221;.<\/p>\n<h3>\n\tComparison to Perl 5<\/h3>\n<p>Perl constructs not supported by this class:<\/p>\n<ul>\n<li>\n\t\tThe conditional constructs (?{X}) and (?(condition)X|Y)<\/li>\n<li>\n\t\tThe embedded code constructs (?{code}) and (??{code})<\/li>\n<li>\n\t\tThe embedded comment syntax (?#comment)<\/li>\n<li>\n\t\tThe preprocessing operations l u, L, and U.<\/p>\n<ul>\n<li>\n\t\t\t\tConstructs supported by this class but not by Perl:<\/p>\n<ul>\n<li>\n\t\t\t\t\t\tPossessive quantifiers, which greedily match as much as they can and do not back off, even when doing so would allow the overall match to succeed<\/li>\n<li>\n\t\t\t\t\t\tCharacter-class union and intersection. Character classes may appear within other character classes, and may be composed by the union operator (implicit) and the intersection operator (&amp;&amp;). The union operator denotes a class that contains every character that is in at least one of its operand classes. The intersection operator denotes a class that contains every character that is in both of its operand classes.<\/li>\n<\/ul>\n<p>\t\t\t\tThe precedence of character-class operators is as follows, from highest to lowest:<\/p>\n<table cellpadding=\"2\" cellspacing=\"2\" width=\"50%\">\n<tbody>\n<tr>\n<td width=\"6\">\n\t\t\t\t\t\t\t\t1<\/td>\n<td width=\"20\">\n\t\t\t\t\t\t\t\tLiteral escape<\/td>\n<td width=\"20\">\n\t\t\t\t\t\t\t\tx<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t\t\t\t\t2<\/td>\n<td>\n\t\t\t\t\t\t\t\tGrouping<\/td>\n<td>\n\t\t\t\t\t\t\t\t[&#8230;]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t\t\t\t\t3<\/td>\n<td>\n\t\t\t\t\t\t\t\tRange<\/td>\n<td>\n\t\t\t\t\t\t\t\ta-z<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t\t\t\t\t4<\/td>\n<td>\n\t\t\t\t\t\t\t\tUnion<\/td>\n<td>\n\t\t\t\t\t\t\t\t[a-e][i-u]<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\t\t\t\t\t5<\/td>\n<td>\n\t\t\t\t\t\t\t\tIntersection<\/td>\n<td>\n\t\t\t\t\t\t\t\t[a-z&amp;&amp;[aeiou]]<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\t\t\t\tNotable differences from Perl:<\/p>\n<ul>\n<li>\n\t\t\t\t\t\tIn Perl, 1 through 9 are always interpreted as back references; a backslash-escaped number greater than 9 is treated as a back reference if at least that many subexpressions exist, otherwise it is interpreted, if possible, as an octal escape. In this class octal escapes must always begin with a zero. In this class, 1 through 9 are always interpreted as back references, and a larger number is accepted as a back reference if at least that many subexpressions exist at that point in the regular expression, otherwise the parser will drop digits until the number is smaller or equal to the existing number of groups or it is one digit<\/li>\n<li>\n\t\t\t\t\t\tPerl uses the g flag to request a match that resumes where the last match left off. This functionality is provided implicitly by the Matcher class: Repeated invocations of the find method will resume where the last match left off, unless the matcher is reset<\/li>\n<li>\n\t\t\t\t\t\tIn Perl, embedded flags at the top level of an expression affect the whole expression. In this class, embedded flags always take effect at the point at which they appear, whether they are at the top level or within a group; in the latter case, flags are restored at the end of the group just as in Perl<\/li>\n<li>\n\t\t\t\t\t\tPerl is forgiving about malformed matching constructs, as in the expression *a, as well as dangling brackets, as in the expression abc], and treats them as literals. This class also accepts dangling brackets but is strict about dangling metacharacters like +, ? and *, and will throw a PatternSyntaxException if it encounters them.<\/li>\n<\/ul>\n<p>\t\t\t\tFor a more precise description of the behavior of regular expression constructs, please see Mastering Regular Expressions, Jeffrey E. F. Friedl, O&#8217;Reilly and Associates, 1997.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Summary of regular-expression constructs Construct Matches &nbsp; Characters x The character x \\| The backslash character \\n The character with octal value 0n (0 &lt;= n &lt;= 7) \\nn The character with octal value 0nn (0 &lt;= n &lt;= 7) \\mnn The character with octal value 0mnn (0 &lt;= m &lt;= 3, 0 &lt;= n&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":24465,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_lmt_disableupdate":"no","_lmt_disable":"","_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"class_list":["post-24468","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Regular Expressions - Product Documentation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/regular-expressions-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Regular Expressions - Product Documentation\" \/>\n<meta property=\"og:description\" content=\"Summary of regular-expression constructs Construct Matches &nbsp; Characters x The character x | The backslash character n The character with octal value 0n (0 &lt;= n &lt;= 7) nn The character with octal value 0nn (0 &lt;= n &lt;= 7) mnn The character with octal value 0mnn (0 &lt;= m &lt;= 3, 0 &lt;= n...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/regular-expressions-1\/\" \/>\n<meta property=\"og:site_name\" content=\"Product Documentation\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-24T17:17:01+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/regular-expressions-1\/\",\"url\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/regular-expressions-1\/\",\"name\":\"Regular Expressions - Product Documentation\",\"isPartOf\":{\"@id\":\"https:\/\/docs.extraview.com\/v25\/#website\"},\"datePublished\":\"2024-02-15T22:53:34+00:00\",\"dateModified\":\"2025-02-24T17:17:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/regular-expressions-1\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/regular-expressions-1\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/regular-expressions-1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/docs.extraview.com\/v25\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ExtraView 25\",\"item\":\"https:\/\/docs.extraview.com\/v25\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Integration Guides\",\"item\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Perforce Integration Guide\",\"item\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Appendices\",\"item\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"Regular Expressions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/docs.extraview.com\/v25\/#website\",\"url\":\"https:\/\/docs.extraview.com\/v25\/\",\"name\":\"ExtraView Product Documentation\",\"description\":\"ExtraView Documentation\",\"publisher\":{\"@id\":\"https:\/\/docs.extraview.com\/v25\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/docs.extraview.com\/v25\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/docs.extraview.com\/v25\/#organization\",\"name\":\"ExtraView Corporation\",\"url\":\"https:\/\/docs.extraview.com\/v25\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/docs.extraview.com\/v25\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/docs-stg.extraview.com\/wp-content\/uploads\/2024\/03\/favicon.png\",\"contentUrl\":\"https:\/\/docs-stg.extraview.com\/wp-content\/uploads\/2024\/03\/favicon.png\",\"width\":512,\"height\":512,\"caption\":\"ExtraView Corporation\"},\"image\":{\"@id\":\"https:\/\/docs.extraview.com\/v25\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Regular Expressions - Product Documentation","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/regular-expressions-1\/","og_locale":"en_US","og_type":"article","og_title":"Regular Expressions - Product Documentation","og_description":"Summary of regular-expression constructs Construct Matches &nbsp; Characters x The character x | The backslash character n The character with octal value 0n (0 &lt;= n &lt;= 7) nn The character with octal value 0nn (0 &lt;= n &lt;= 7) mnn The character with octal value 0mnn (0 &lt;= m &lt;= 3, 0 &lt;= n...","og_url":"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/regular-expressions-1\/","og_site_name":"Product Documentation","article_modified_time":"2025-02-24T17:17:01+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/regular-expressions-1\/","url":"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/regular-expressions-1\/","name":"Regular Expressions - Product Documentation","isPartOf":{"@id":"https:\/\/docs.extraview.com\/v25\/#website"},"datePublished":"2024-02-15T22:53:34+00:00","dateModified":"2025-02-24T17:17:01+00:00","breadcrumb":{"@id":"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/regular-expressions-1\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/regular-expressions-1\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/regular-expressions-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/docs.extraview.com\/v25\/"},{"@type":"ListItem","position":2,"name":"ExtraView 25","item":"https:\/\/docs.extraview.com\/v25\/"},{"@type":"ListItem","position":3,"name":"Integration Guides","item":"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/"},{"@type":"ListItem","position":4,"name":"Perforce Integration Guide","item":"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/"},{"@type":"ListItem","position":5,"name":"Appendices","item":"https:\/\/docs.extraview.com\/v25\/extraview-25\/integration-guides-1\/perforce-integration-guide-1\/appendices-7\/"},{"@type":"ListItem","position":6,"name":"Regular Expressions"}]},{"@type":"WebSite","@id":"https:\/\/docs.extraview.com\/v25\/#website","url":"https:\/\/docs.extraview.com\/v25\/","name":"ExtraView Product Documentation","description":"ExtraView Documentation","publisher":{"@id":"https:\/\/docs.extraview.com\/v25\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/docs.extraview.com\/v25\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/docs.extraview.com\/v25\/#organization","name":"ExtraView Corporation","url":"https:\/\/docs.extraview.com\/v25\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/docs.extraview.com\/v25\/#\/schema\/logo\/image\/","url":"https:\/\/docs-stg.extraview.com\/wp-content\/uploads\/2024\/03\/favicon.png","contentUrl":"https:\/\/docs-stg.extraview.com\/wp-content\/uploads\/2024\/03\/favicon.png","width":512,"height":512,"caption":"ExtraView Corporation"},"image":{"@id":"https:\/\/docs.extraview.com\/v25\/#\/schema\/logo\/image\/"}}]}},"taxonomy_info":[],"featured_image_src_large":false,"author_info":{"display_name":"carl.koppel","author_link":"https:\/\/docs.extraview.com\/v25\/author\/carl-koppel\/"},"comment_info":0,"_links":{"self":[{"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/pages\/24468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/comments?post=24468"}],"version-history":[{"count":0,"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/pages\/24468\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/pages\/24465"}],"wp:attachment":[{"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/media?parent=24468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}