From 21bac8428e805a9d8f2163f58709f8ee85824ac7 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Fri, 29 Mar 2019 20:12:28 +0100 Subject: [PATCH] docs/cmds/string: Fix lists sphinx _really_ likes its empty lines before lists! [ci skip] --- sphinx_doc_src/cmds/string.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sphinx_doc_src/cmds/string.rst b/sphinx_doc_src/cmds/string.rst index 3ed356a02..4009588e3 100644 --- a/sphinx_doc_src/cmds/string.rst +++ b/sphinx_doc_src/cmds/string.rst @@ -177,6 +177,7 @@ Both the ``match`` and ``replace`` subcommand support regular expressions when u In general, special characters are special by default, so ``a+`` matches one or more "a"s, while ``a\+`` matches an "a" and then a "+". ``(a+)`` matches one or more "a"s in a capturing group (``(?:XXXX)`` denotes a non-capturing group). For the replacement parameter of ``replace``, ``$n`` refers to the n-th group of the match. In the match parameter, ``\n`` (e.g. ``\1``) refers back to groups. Some features include repetitions: + - ``*`` refers to 0 or more repetitions of the previous expression - ``+`` 1 or more - ``?`` 0 or 1. @@ -185,6 +186,7 @@ Some features include repetitions: - ``{n,}`` n or more Character classes, some of the more important: + - ``.`` any character except newline - ``\d`` a decimal digit and ``\D``, not a decimal digit - ``\s`` whitespace and ``\S``, not whitespace @@ -210,12 +212,14 @@ Character classes, some of the more important: - ``[[:xdigit:]]`` : "hexadecimal digit" Groups: + - ``(...)`` is a capturing group - ``(?:...)`` is a non-capturing group - ``\n`` is a backreference (where n is the number of the group, starting with 1) - ``$n`` is a reference from the replacement expression to a group in the match expression. And some other things: + - ``\b`` denotes a word boundary, ``\B`` is not a word boundary. - ``^`` is the start of the string or line, ``$`` the end. - ``|`` is "alternation", i.e. the "or".