coltnz / re-ext

Sometimes you want to compose regexs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

re-ext

A Clojure library to provide regular expression utilities in particular designed to allow composing regexs.

Usage

;compiled at macro time
(re/and #"a" #"b")  
=> #"(ab)"
;compiled at run time
(re/or #"a" (re-pattern "b"))  
=> #"(a|b)a"
;compiled at macro time
(re/or #"a" (re/and #"b")) 
 => #"(a|(b))"
;compiled at run time
(def def-re #"bc") 
(let [local-re #"ef"]
  (re/or def-re local-re))
=> #"(bcd|bcd)"

License

Copyright © 2017 Colin Taylor & Contributors

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

Sometimes you want to compose regexs.

License:Eclipse Public License 1.0


Languages

Language:Clojure 100.0%