📎 Webclip
verbal_expressions
VerbalExpressions is a Ruby library for building difficult regular expressions more easily. It is ported from the JavaScript VerbalExpressions project and includes examples for URL testing, replacing strings, and capturing values.
Reading notes#
- It is installed with
gem install verbal_expressions, then loaded withrequire verbal_expressions. - The README shows an example for testing a valid URL and printing the generated regex.
- It shows a replacement example where the expression finds
birdandgsubchanges the string. - It shows capturing syntax with
begin_captureandend_capture, including a named capture example. - The repo says documentation is limited, and points to the original JavaScript repo wiki for more method documentation.
- It says most methods were ported as of v0.1.0 of the JavaScript repo.
- It asks contributors to clone the repo, fork it, and open pull requests.
- It notes that modifier code has not been ported yet because Ruby Regexp handles modifiers differently.
- It says
oris aliased toalternatively, andthenmust be replaced withfindbecause both names are reserved in Ruby.
