== name == CL-PPCRE == category == Regular expressions == author == Dr. Edmund Weitz (mailto(edi@agharta.de), mailto(edi@weitz.de)) == author-image == == short-description == CL-PPCRE is a portable regular expression library for Common Lisp which is compatible with Perl. == long-description == CL-PPCRE is a portable regular expression library for Common Lisp which has the following features: * It is compatible with Perl. * It is fast. * It is portable, i.e. the code aims to be strictly ANSI-compliant and is known to work with lots of different CL implementations. * It is thread-safe. * It comes with convenient features like a bold(SPLIT) function, a couple of bold(DO)-like loop constructs, and a regex-based bold(APROPOS) feature similar to the one found in Emacs. * In addition to specifying regular expressions as strings like in Perl you can also use S-expressions which obviously is more Lisp-y. * Is it is fully documented. * It comes with a BSD-style license so you can basically do with it whatever you want. CL-PPCRE has been used successfully in various applications like href(BioLingua,http://nostoc.stanford.edu/Docs/), href(LoGS,http://www.hpc.unm.edu/~download/LoGS/), or href(The Regex Coach,http://weitz.de/regex-coach/). == examples == * (scan "(a)*b" "xaaabd") 1 5 #(3) #(4) * (scan "(a)*b" "xaaabd" :start 1) 1 5 #(3) #(4) * (scan "(a)*b" "xaaabd" :start 2) 2 5 #(3) #(4) * (scan "(a)*b" "xaaabd" :end 4) NIL * (scan '(:GREEDY-REPETITION 0 NIL #\b) "bbbc") 0 3 #() #() * (scan '(:GREEDY-REPETITION 4 6 #\b) "bbbc") NIL * (let ((s (create-scanner "(([a-c])+)x"))) (scan s "abcxy")) 0 4 #(0 2) #(3 3) * (register-groups-bind (fname lname (#'parse-integer date month year)) ("(\\w+)\\s+(\\w+)\\s+(\\d{1,2})\\.(\\d{1,2})\\.(\\d{4})" "Frank Zappa 21.12.1940") (list fname lname (encode-universal-time 0 0 0 date month year))) ("Frank" "Zappa" 1292882400) * (all-matches-as-strings "\\w*" "foo bar baz") ("foo" "" "bar" "" "baz" "") * (split "\\s+" "foo bar baz frob") ("foo" "bar" "baz" "frob") * (regex-replace-all "(?i)fo+" "foo Fooo FOOOO bar" "frob" :preserve-case t) "frob Frob FROB bar" * (regex-apropos "mult\\w+-val\\w+" :cl) MULTIPLE-VALUE-LIST [macro] MULTIPLE-VALUE-BIND [macro] MULTIPLE-VALUE-PROG1 [special operator] MULTIPLE-VALUES-LIMIT [constant] value: 536870911 MULTIPLE-VALUE-SETQ [macro] MULTIPLE-VALUE-CALL [special operator] == instructions == Either load the file "load.lisp" or use ASDF: (asdf:oos 'asdf:load-op :cl-ppcre) == tutorial == Lots of examples can be found in the documentation. == home-url == http://weitz.de/cl-ppcre/ == doc-url == http://weitz.de/cl-ppcre/ == license == CL-PPCRE comes with a href(BSD license,http://www.opensource.org/licenses/bsd-license.php). == book == href(Mastering Regular Expressions,http://www.oreilly.com/catalog/regex2/) by Jeffrey Friedl == references == A nice tool (shameless self-plug, actually) to learn regular expressions is href(The Regex Coach,http://weitz.de/regex-coach/), which uses CL-PPCRE and is of course also written in Lisp. == source-fooball == Download the source code from href(http://weitz.de/files/cl-ppcre.tar.gz,http://weitz.de/files/cl-ppcre.tar.gz) or href(ftp://ftp.franz.com/pub/lispwire/edi/cl-ppcre-1.0.0.tar.gz,ftp://ftp.franz.com/pub/lispwire/edi/cl-ppcre-1.0.0.tar.gz). bold(NOTE: Edi's site might have a newer version.) == release-date == 2004-12-22 == release-version == 1.0.0 == status == Stable. == history == == acl-dependencies == == other-dependencies == == platform == == ad == regexp