Re:A human way to define regular expressions in Ruby
by krainboltgreene on Thursday September 05, 2013 @05:39PM
(#6337251)
Thoughts on doing it better? The DSL is just a wrapper for the objects.
[ Parent
| on HN ]
Re:A human way to define regular expressions in Ruby
by wyantb on Thursday September 05, 2013 @06:48PM
(#6337621)
I may as well make one suggestion along these lines ( implemented in a similar JS library I whipped up not too long ago: https://github.com/wyantb/js-regex ).
Macros! https://github.com/wyantb/js-regex#macros
Given some named macro, whenever the user wants to use it, they use addMacro (or some analogous method).