summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-10-03 20:06:41 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-10-03 20:06:41 -0700
commitb74633f86d69cf1aabebe0b976d695b7a61bddc6 (patch)
treef20f6760810eaf33f2615a23284559ce3f5a668f /txr.1
parentebfe50c31d62d647b586619f56aa754971cfdf69 (diff)
downloadtxr-b74633f86d69cf1aabebe0b976d695b7a61bddc6.tar.gz
txr-b74633f86d69cf1aabebe0b976d695b7a61bddc6.tar.bz2
txr-b74633f86d69cf1aabebe0b976d695b7a61bddc6.zip
New function rra.
* regex.c (range_regex_all, regex_range_all): New functions. (regex_init): Register rra intrinsic function. * regex.c (range_regex_all, regex_range_all): Declared. * txr.1: Documented rra.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.161
1 files changed, 61 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 108dc600..51f35bc8 100644
--- a/txr.1
+++ b/txr.1
@@ -32872,6 +32872,67 @@ function is equivalent to the
function, such that correspondingly named
arguments have the same semantics.
+.coNP Function @ rra
+.synb
+.mets (rra < regex >> [ start <> [ end ]] << string )
+.syne
+.desc
+The
+.code rra
+function searches
+.meta string
+between the
+.meta start
+and
+.meta end
+position for matches for the regular expression
+.metn regex .
+
+The matches are returned as a list of range objects.
+
+The
+.meta start
+argument defaults to zero, and
+.meta end
+defaults to the length of the string (the position one
+past the last character).
+
+Negative values of
+.meta start
+and
+.meta end
+indicate positions from the end of the string, such that -1
+denotes the last character, -2 the second-to-last and so forth.
+
+If
+.meta start
+is so negative that it refers before the start of
+.metn string ,
+it is treated as zero. If this situation is true of the
+.meta end
+argument, then the function returns
+.codn nil .
+
+If
+.meta start
+refers to a character position beyond the length of
+.meta string
+(two characters or more beyond the end of the string),
+then the function returns
+.codn nil .
+If this situation is true of
+.metn end ,
+then
+.meta end
+is is curtailed to the the string length.
+
+The
+.code rra
+function returns all non-overlapping matches, including
+zero length matches. Zero length matches may occur before
+the first character of the string, or after the last
+character. If so, these are included.
+
.coNP Functions @, f^$ @ f^ and @ f$
.synb
.mets (f^$ < regex <> [ position ])