From 43fa874fd295b2c765cddd14939a60a47e190148 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 5 Dec 2013 23:47:58 -0800 Subject: * regex.c (regex_compile): Handle string input. * regex.h (regex_compile): Don't call argument regex_sexp, since it can be a string. * txr.1: Updated. --- txr.1 | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index 2906a0ab..ad83f669 100644 --- a/txr.1 +++ b/txr.1 @@ -9348,16 +9348,20 @@ object. For any other object type, it returns nil. .TP Syntax: - (regex-compile
) + (regex-compile ) .TP Description: The regex compile function takes the source code of a regular expression, -expressed as a Lisp data structure, and compiles it to a regular expression -object. +expressed as a Lisp data structure representing an abstract syntax tree, or +else a regular expression specified as a character string, and compiles it to a +regular expression object. -Suitable source code is produced by regex-parse. +If is a character string, it is parsed to an +abstract syntax tree first, if by a call to (regex-parse ). +If the parse is successful (the result is not nil) then +it is compiled by a recursive call to regex-compile. .TP Examples: @@ -9372,6 +9376,9 @@ Examples: ;; #/a|b|c/ (regex-compile '(or (or #\ea #\eb) #\ec)) + ;; string + (regex-compile "a|b|c") + .SS Function regex-parse .TP -- cgit v1.2.3