Commit 43be3b77 authored by Zach Beane's avatar Zach Beane
Browse files

Finish off regexp API.

parent 42bb79f0
......@@ -42,9 +42,9 @@ longer anonymous, but has a meaningful name name."
(find feature *features*))
(defun excl:match-re (pattern string &key (return :string))
(defun excl:match-re (pattern string &key (return :string) case-fold)
(multiple-value-bind (start end regs-starts regs-ends)
(scan pattern string)
(scan (create-scanner pattern :case-insensitive-mode case-fold) string )
(when (and start end)
(ecase return
(:index
......@@ -54,11 +54,16 @@ longer anonymous, but has a meaningful name name."
(map 'list (lambda (start end)
(subseq string start end))
regs-starts
regs-ends))))))))
regs-ends))))
((nil)
t)))))
(defun excl:match-regexp (pattern string &key (return :string))
(excl:match-re pattern string :return return))
(defun excl:compile-regexp (pattern)
(create-scanner pattern))
(defmacro excl:with-output-to-buffer ((stream) &body body)
`(with-output-to-sequence (,stream)
......
......@@ -182,7 +182,8 @@
#:lockable-object)
(:export #:match-regexp
#:match-re
#:replace-regexp)
#:replace-regexp
#:compile-regexp)
(:export #:with-output-to-buffer)
(:export #:def-stream-class
#:terminal-simple-stream
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment