summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2012-04-19 21:54:09 -0700
committerKaz Kylheku <kaz@kylheku.com>2012-04-19 21:54:09 -0700
commit2614361741b85a71b06fc4d70538e0b5d8fb660b (patch)
tree549e3075d38f34301f86dcc00725070b90548f2f
parent66a38d816de5d5932fd2d99c74538c43422ad44a (diff)
downloadtxr-2614361741b85a71b06fc4d70538e0b5d8fb660b.tar.gz
txr-2614361741b85a71b06fc4d70538e0b5d8fb660b.tar.bz2
txr-2614361741b85a71b06fc4d70538e0b5d8fb660b.zip
* txr.1: Documented new regex tokens.
-rw-r--r--ChangeLog2
-rw-r--r--txr.116
2 files changed, 17 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 92f9cfcc..75b111d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -33,6 +33,8 @@
* regex.h (space_k, digit_k, word_char_k, cspace_k, cdigit_k,
cword_char_k, regex_space_chars, regex_init): Declared.
+ * txr.1: Documented.
+
2012-04-15 Kaz Kylheku <kaz@kylheku.com>
* eval.c (eval_init): New intrinsic functions remq*, remql*,
diff --git a/txr.1 b/txr.1
index 81583d97..48358cc6 100644
--- a/txr.1
+++ b/txr.1
@@ -846,9 +846,13 @@ supports the following syntax:
Character class: matches a single character, from the set specified by
special syntax written between the square brackets.
Supports basic regexp character class syntax; no POSIX
-notation like [:digit:]. The class [a-zA-Z] means match an uppercase
+notation like [:digit:]. The regex tokens \es, \ed and \ew are
+permitted in character classes, but not their complementing counterparts.
+These tokens simply contribute their characters to the class.
+The class [a-zA-Z] means match an uppercase
or lowercase letter; the class [0-9a-f] means match a digit or
a lowercase letter; the class [^0-9] means match a non-digit, et cetera.
+The class [\ed.] means match a digit or the period character.
A ] or - can be used within a character class, but must be escaped
with a backslash. A ^ in the first position denotes a complemented
class, unless it is escaped by backslash. In any other position, it denotes
@@ -861,6 +865,16 @@ are ordinary. Unescaped / characters can appear within a character class. The
empty character class [] matches no character at all, and its complement [^]
matches any character, and is treated as a synonym for the . (period) wildcard
operator.
+.IP "\es, \ew and \ed"
+These regex tokens each match a single character.
+The \es regex token matches a wide variety of ASCII whitespace characters
+and Unicode spaces. The \ew token matches alphabetic word characters; it
+is equivalent to the character class [A-Za-z_]. The \ed token matches
+a digit, and is equivalent to [0-9].
+.IP "\eS, \eW and \eD"
+These regex tokens are the complemented counterparts of \es, \ew and \ed.
+The \eS token matches all those characters which \es does not match,
+\eW matches all characters that \ew does not match and \eD matches nondigits.
.IP empty
An empty expression is a regular expression. It represents the set of strings
consisting of the empty string; i.e. it matches just the empty string. The