diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2023-03-16 13:18:41 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2023-03-16 19:05:09 -0700 |
commit | 4143535ae5eb9385a86240e152be873cc4348e03 (patch) | |
tree | 13cf54b103ef4d8a4540dc87aad7998797cb41e0 /doc | |
parent | a2f0f9376e110d6c930b0cd3cf533c7fd3b7b917 (diff) | |
download | consfigurator-4143535ae5eb9385a86240e152be873cc4348e03.tar.gz |
add regexp trailing option to attempt to parse matches as numbers
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/reader.rst | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/doc/reader.rst b/doc/reader.rst index 1d78cd2..ed54860 100644 --- a/doc/reader.rst +++ b/doc/reader.rst @@ -35,9 +35,12 @@ This provides an abbreviation for shell- and Perl-style regexp matching: => ("two" "four" "six") Any delimiters supported by ``CL-INTERPOL`` may be used, and the ``m`` is -always optional. Trailing options ``g``, ``i``, ``m``, ``s`` and ``x`` are -meaningful. The return value depends on the numeric argument before the -tilde: +always optional. Standard trailing options ``g``, ``i``, ``m``, ``s`` and +``x`` are meaningful. There is also ``p``, which means to attempt to parse +the matched strings and substrings as numbers; if a substring cannot be parsed +as a number, it is returned unmodified. + +The return value depends on the numeric argument before the tilde: - ``#~m//``, with no argument, returns a vector of the substrings corresponding to the capture groups, or if there were no capture groups, @@ -65,8 +68,9 @@ This provides an abbreviation for shell- and Perl-style regexp substitution: (mapcar #~s/:.+:/`\&`/ '(":Hello:" ":Goodbye:")) => ("`:Hello:`" "`:Goodbye:`") Again, any delimiters supported by ``CL-INTERPOL`` may be used, and the same -trailing options are meaningful. This is ``CL-PPCRE:REGEX-REPLACE`` or -``CL-PPCRE:REGEX-REPLACE-ALL``, which see regarding return values. +trailing options, except for ``p``, are meaningful. This is +``CL-PPCRE:REGEX-REPLACE`` or ``CL-PPCRE:REGEX-REPLACE-ALL``, which see +regarding return values. ``#>EOF>`` and ``#>>EOF>>``: Heredocs ------------------------------------- |