summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2013-05-20 08:07:52 -0700
committerKaz Kylheku <kaz@kylheku.com>2013-05-20 08:07:52 -0700
commitc5cb755b237d8d96141569b9838428575b0d4992 (patch)
treeca207c815f4d94bebb97afc050ebb4d0f42edb0a /txr.1
parent3c16dfef0ae511e2c43283030a6fd2381570b28f (diff)
downloadtxr-c5cb755b237d8d96141569b9838428575b0d4992.tar.gz
txr-c5cb755b237d8d96141569b9838428575b0d4992.tar.bz2
txr-c5cb755b237d8d96141569b9838428575b0d4992.zip
* txr.1: Misleading documentation updated for split-str, which
takes a regex, not just a fixed string separator. Clarified the corner case behaviors too.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.126
1 files changed, 18 insertions, 8 deletions
diff --git a/txr.1 b/txr.1
index e4094d39..433c74c2 100644
--- a/txr.1
+++ b/txr.1
@@ -7514,14 +7514,24 @@ Syntax:
Description:
The split-str function breaks the <string> into pieces, returing a list
-thereof. The <sep> argument must be a string. It specifies the separator
-character sequence within <string>. All non-overlapping occurences of
-<sep> within <string> are identified in left to right order, and are removed
-from <string>. The string is broken into pieces according to the gaps left
-behind by the removed separators.
-
-Adjacent occurrences of <sep> within <string> are considered to be separate
-gaps which come between empty strings.
+thereof. The <sep> argument must be either a string or a regular expression.
+It specifies the separator character sequence within <string>.
+
+All non-overlapping matches for <sep> within <string> are identified in left
+to right order, and are removed from <string>. The string is broken into pieces
+according to the gaps left behind by the removed separators, and a list
+of the remaining pieces is returned.
+
+If a match for <sep> is not found in the string at all, then the string is not
+split at all: a list of one element is returned containing the original
+string.
+
+If <sep> matches the entire string, then a list of two empty strings is
+returned, except in the case that the original string is empty, in which case a
+list of one element is returned, containing the empty string.
+
+Whenever two adjacent matches for <sep> occur, they are considered separate
+cuts with an empty piece between them.
This operation is nondestructive: <string> is not modified in any way.