diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2013-06-11 16:15:34 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2013-06-11 16:15:34 -0700 |
commit | 399b4b6a5082aa6f14a98bc50b29baeca686aa39 (patch) | |
tree | fcf71aad074e38aecc2a13a192756791a1e02783 /txr.1 | |
parent | a6b0130ceaeadce6845d698fb68712dc2786e918 (diff) | |
download | txr-399b4b6a5082aa6f14a98bc50b29baeca686aa39.tar.gz txr-399b4b6a5082aa6f14a98bc50b29baeca686aa39.tar.bz2 txr-399b4b6a5082aa6f14a98bc50b29baeca686aa39.zip |
* eval.c (eval_init): tok-str acquires new parameter
* lib.c (tok_str): New parameter, keep_sep.
* lib.h (tok_str): Declaration updated.
* txr.1: Documentation for tok-str updated.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -7572,7 +7572,7 @@ This operation is nondestructive: <string> is not modified in any way. .TP Syntax: - (tok-str <string> <regex>) + (tok-str <string> <regex> [<keep-between>]) .TP Description: @@ -7589,6 +7589,13 @@ list ("a" "" "" ""). After the token "a" is extracted from a non-empty match for the regex, the regex is considered to matches three more times: before the "b", between "b" and "c", and after the "c". +If the <keep-between> argument is specified, and is not nil, then the behavior +of tok-str changes in the following way. The pieces of <string> which are +skipped by the search for tokens are included in the output. If no token is +found in <string>, then a list of one element is returned, containing <string>. +Generally, if N tokens are found, then the returned list consists of 2N + 1 +elements. The first element of the list is the (possibly empty) substring which had to be skipped to find the first token. Then the token follows. The next element is the next skipped substring and so on. The last element is the substring of <string> between the last token and the end. + .SS Function list-str .TP |