[Cmake-commits] CMake branch, master, updated. v3.12.0-256-g19fac85

Kitware Robot kwrobot at kitware.com
Wed Jul 18 11:15:03 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  19fac8572a97e20376dea8d81fae594378cf0975 (commit)
       via  4b35dab8916b9c88336a776eaaadd8e6746a50b6 (commit)
      from  11d71e6cd0eedae224eca52d4f8bc6cb6baf46d8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=19fac8572a97e20376dea8d81fae594378cf0975
commit 19fac8572a97e20376dea8d81fae594378cf0975
Merge: 11d71e6 4b35dab
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jul 18 15:09:56 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Jul 18 11:10:02 2018 -0400

    Merge topic 'doc-regex-notes'
    
    4b35dab891 Help: Document how escape sequences work in a regex
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2221


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4b35dab8916b9c88336a776eaaadd8e6746a50b6
commit 4b35dab8916b9c88336a776eaaadd8e6746a50b6
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jul 18 10:23:26 2018 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jul 18 10:36:00 2018 -0400

    Help: Document how escape sequences work in a regex
    
    Our regex engine doesn't interpret `\`-escapes but CMake language escape
    sequences may be used to pass literal whitespace characters to it.

diff --git a/Help/command/string.rst b/Help/command/string.rst
index efa923b..29a153a 100644
--- a/Help/command/string.rst
+++ b/Help/command/string.rst
@@ -151,6 +151,20 @@ has lower precedence than concatenation.  This means that the regular
 expression ``^ab+d$`` matches ``abbd`` but not ``ababd``, and the regular
 expression ``^(ab|cd)$`` matches ``ab`` but not ``abd``.
 
+Backslash (``\``) characters in regular expressions are interpreted
+literally and do not escape anything or represent placeholders.
+However, CMake language :ref:`Escape Sequences` such as ``\t``,
+``\r``, ``\n``, and ``\\`` may be used to construct literal tabs,
+carriage returns, newlines, and backslashes (respectively) to pass
+in a regex.  For example:
+
+* The quoted argument ``"[ \t\r\n]"`` specifies a regex that matches
+  any single whitespace character.
+* The quoted argument ``"[/\\]"`` specifies a regex that matches
+  a single forward slash ``/`` or backslash ``\``.
+* The quoted argument ``"[A-Za-z0-9_]"`` specifies a regex that matches
+  any single "word" character in the C locale.
+
 Manipulation
 ^^^^^^^^^^^^
 

-----------------------------------------------------------------------

Summary of changes:
 Help/command/string.rst | 14 ++++++++++++++
 1 file changed, 14 insertions(+)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list