Skip to content
/ re21 Public

CL21's spin-off project that provides neat APIs for regular expressions.

Notifications You must be signed in to change notification settings

fukamachi/re21

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RE21

Quicklisp dist

RE21 is CL21's spin-off project that provides neat APIs for regular expressions.

Usage

(use-package :re21)

(re-match "^Hello, (.+?)!$" "Hello, World!")
;=> "Hello, World!"
;   #("World")

(re-match "^(\\d{4})-(\\d{2})-(\\d{2})$" "2016-01-06")
;=> "2016-01-06"
;   #("2016" "01" "06")

(re-groups "(\\w+)\\s+(\\w+)\\s+(\\d{1,2})\\.(\\d{1,2})\\.(\\d{4})"
           "Frank Zappa 21.12.1940")
;=> ("Frank" "Zappa" "21" "12" "1940")

(re-split "-" "2016-01-06")
;=> ("2016" "01" "06")

(re-replace "a" "Eitaro Fukamachi" "α" :global t)
;=> "Eitαrow Fukαmαchi"
;   T

;; Enable the syntax for regular expressions
(syntax:use-syntax :re21)

(#/^Hello, (.+?)!$/ "Hello, World!")
;=> "Hello, World!"
;   #("World")

(#/^(\d{4})-(\d{2})-(\d{2})$/ "2014-01-23")
;=> "2014-01-23"
;   #("2014" "01" "23")

(re-replace #/a/g "Eitaro Fukamachi" "α")
;=> "Eitαro Fukαmαchi"
;   T

Installation

cd ~/common-lisp
git clone https://github.com/fukamachi/re21
(ql:quickload :re21)

Credits

License

RE21 is free and unencumbered software released into the public domain.

About

CL21's spin-off project that provides neat APIs for regular expressions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages