||regular expression engine
||2003-11-06 21:07:41 GMT
||2004-09-07 19:28:18 GMT
(Projects of this owner)
Here is an Regexp engine written entirely in Ruby.
It allows you to search in text with advanced search patterns.
It supports Perl5 syntax... plus some perl6 syntax (more to
come in the future). Its fairly compatible with Ruby's native
regexp engine (GNU), and when running against the Rubicon
testsuite, it passes 96.66% out of 1560 total tests.
The implementation is simple, yet without any optimizations.
Therefore speed is slow.. At some point when optimizations
are in place, I plan to do a re-implementation in C++.
Because of the simplicity, the code should be easy to grasp
and extend with your own custom code.
One feature that may interest you is the #tree method, you can use like this:
irb(main):001:0> require 'regexp'
irb(main):002:0> puts /ab|cd(?=x)|xxx/.tree
| +-Inside set="a"
| +-Inside set="b"
| +-Inside set="c"
| +-Inside set="d"
| +-Lookahead positive
| +-Inside set="x"
This can be handy sometimes for debugging.