]> granicus.if.org Git - llvm/commitdiff
[doc] Give a workaround for a FileCheck regex that ends in a brace.
authorPaul Robinson <paul.robinson@sony.com>
Fri, 2 Aug 2019 16:07:48 +0000 (16:07 +0000)
committerPaul Robinson <paul.robinson@sony.com>
Fri, 2 Aug 2019 16:07:48 +0000 (16:07 +0000)
Addresses PR42864.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367689 91177308-0d34-0410-b5e6-96231b3b80d8

docs/CommandGuide/FileCheck.rst

index c5521e4e9bd50fef8d760bd495aad5f93235daba..429f3ad07d749bc6f525ead50a2f8496d0304134 100644 (file)
@@ -527,7 +527,10 @@ Because regular expressions are enclosed with double braces, they are
 visually distinct, and you don't need to use escape characters within the double
 braces like you would in C.  In the rare case that you want to match double
 braces explicitly from the input, you can use something ugly like
-``{{[{][{]}}`` as your pattern.
+``{{[}][}]}}`` as your pattern.  Or if you are using the repetition count
+syntax, for example ``[[:xdigit:]]{8}`` to match exactly 8 hex digits, you
+would need to add parentheses like this ``{{([[:xdigit:]]{8})}}`` to avoid
+confusion with FileCheck's closing double-brace.
 
 FileCheck String Substitution Blocks
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~