X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/46f4442e9a5a4f3b98b7c1083586332f6a8a99a4..HEAD:/icuSources/i18n/regexcst.txt diff --git a/icuSources/i18n/regexcst.txt b/icuSources/i18n/regexcst.txt index 77ebd960..d69a7ea3 100644 --- a/icuSources/i18n/regexcst.txt +++ b/icuSources/i18n/regexcst.txt @@ -1,7 +1,8 @@ - +# Copyright (C) 2016 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html #***************************************************************************** # -# Copyright (C) 2002-2007, International Business Machines Corporation and others. +# Copyright (C) 2002-2015, International Business Machines Corporation and others. # All Rights Reserved. # #***************************************************************************** @@ -147,6 +148,7 @@ open-paren-extended: open-paren-lookbehind: '=' n term ^expr-cont doOpenLookBehind # (?<= '!' n term ^expr-cont doOpenLookBehindNeg # (? ... ), position currently on the name. +# +named-capture: + ascii_letter n named-capture doContinueNamedCapture + digit_char n named-capture doContinueNamedCapture + '>' n term ^expr-quant doOpenCaptureParen # common w non-named capture. + default errorDeath doBadNamedCapture # # quant-star Scanning a '*' quantifier. Need to look ahead to decide @@ -241,12 +251,18 @@ backslash: 'd' n expr-quant doBackslashd 'D' n expr-quant doBackslashD 'G' n term doBackslashG + 'h' n expr-quant doBackslashh + 'H' n expr-quant doBackslashH + 'k' n named-backref 'N' expr-quant doNamedChar # \N{NAME} named char 'p' expr-quant doProperty # \p{Lu} style property 'P' expr-quant doProperty + 'R' n expr-quant doBackslashR 'Q' n term doEnterQuoteMode 'S' n expr-quant doBackslashS 's' n expr-quant doBackslashs + 'v' n expr-quant doBackslashv + 'V' n expr-quant doBackslashV 'W' n expr-quant doBackslashW 'w' n expr-quant doBackslashw 'X' n expr-quant doBackslashX @@ -257,6 +273,24 @@ backslash: default n expr-quant doEscapedLiteralChar +# named-backref Scanned \k +# Leading to \k +# Failure to get the full sequence is an error. +# +named-backref: + '<' n named-backref-2 doBeginNamedBackRef + default errorDeath doBadNamedCapture + +named-backref-2: + ascii_letter n named-backref-3 doContinueNamedBackRef + default errorDeath doBadNamedCapture + +named-backref-3: + ascii_letter n named-backref-3 doContinueNamedBackRef + digit_char n named-backref-3 doContinueNamedBackRef + '>' n expr-quant doCompleteNamedBackRef + default errorDeath doBadNamedCapture + # # [set expression] parsing, @@ -444,6 +478,10 @@ set-escape: 'W' n set-after-range doSetBackslash_W 'd' n set-after-range doSetBackslash_d 'D' n set-after-range doSetBackslash_D + 'h' n set-after-range doSetBackslash_h + 'H' n set-after-range doSetBackslash_H + 'v' n set-after-range doSetBackslash_v + 'V' n set-after-range doSetBackslash_V default n set-after-lit doSetLiteralEscaped #