diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-09-11 19:55:32 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-09-11 19:55:32 -0700 |
commit | fc5935a9fe816d64291e66b1ca5133a27f5f0230 (patch) | |
tree | ffd7371d6ee3817aedf45d63e6606f072a16ac83 /regex.h | |
parent | 6417918274d7d7d8d5b7bb675906f8e38d25c073 (diff) | |
download | txr-fc5935a9fe816d64291e66b1ca5133a27f5f0230.tar.gz txr-fc5935a9fe816d64291e66b1ca5133a27f5f0230.tar.bz2 txr-fc5935a9fe816d64291e66b1ca5133a27f5f0230.zip |
regex: new function, regex-prefix-match.
This new function allows a program to determine whether a
given string is the prefix of any of the strings denoted by a
regular expression; or, in alternative words, whether a given
string is the prefix of a possibly longer string which matches
a regular expression.
* regex.c (regex_machine_infer_init_state): New static
function.
(regex_prefix_match): New function.
(regex_init): regex-prefix-match intrinsic registered.
regex.h (regex_prefix_match): Declared.
* txr.1: Documented.
Diffstat (limited to 'regex.h')
-rw-r--r-- | regex.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -42,6 +42,7 @@ val match_regex_right(val str, val regex, val end); val search_regst(val haystack, val needle_regex, val start_num, val from_end); val match_regst(val str, val regex, val pos); val match_regst_right(val str, val regex, val end); +val regex_prefix_match(val reg, val str, val pos); val regsub(val regex, val repl, val str); val read_until_match(val regex, val stream, val keep_match); val regex_match_full(val regex, val arg1, val arg2); |