llvm.org GIT mirror llvm / a0af046
[FileCheck] regexp doc update/fix Minor doc update that the FileCheck matcher supports POSIX ERE. It also fixes a minor issue in the regexp describing a variable name: underscores are allowed too. Differential Revision: https://reviews.llvm.org/D38787 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315679 91177308-0d34-0410-b5e6-96231b3b80d8 Sjoerd Meijer 1 year, 11 months ago
1 changed file(s) with 6 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
396396 For most uses of FileCheck, fixed string matching is perfectly sufficient. For
397397 some things, a more flexible form of matching is desired. To support this,
398398 FileCheck allows you to specify regular expressions in matching strings,
399 surrounded by double braces: ``{{yourregex}}``. Because we want to use fixed
400 string matching for a majority of what we do, FileCheck has been designed to
401 support mixing and matching fixed string matching with regular expressions.
402 This allows you to write things like this:
399 surrounded by double braces: ``{{yourregex}}``. FileCheck implements a POSIX
400 regular expression matcher; it supports Extended POSIX regular expressions
401 (ERE). Because we want to use fixed string matching for a majority of what we
402 do, FileCheck has been designed to support mixing and matching fixed string
403 matching with regular expressions. This allows you to write things like this:
403404
404405 .. code-block:: llvm
405406
433434 variable ``REGISTER``. The second line verifies that whatever is in
434435 ``REGISTER`` occurs later in the file after an "``andw``". :program:`FileCheck`
435436 variable references are always contained in ``[[ ]]`` pairs, and their names can
436 be formed with the regex ``[a-zA-Z][a-zA-Z0-9]*``. If a colon follows the name,
437 be formed with the regex ``[a-zA-Z_][a-zA-Z0-9_]*``. If a colon follows the name,
437438 then it is a definition of the variable; otherwise, it is a use.
438439
439440 :program:`FileCheck` variables can be defined multiple times, and uses always