[plt-dev] regexp equality
Jay McCarthy wrote at 02/19/2010 01:20 PM:
> How do I test regexps for equality?
>
Comparing the write format has limited usefulness:
(equal? (format "~S" #rx"aaa") (format "~S" #rx"aaa")) ==> #t
(equal? (format "~S" #rx"aaa") (format "~S" #rx"bbb")) ==> #f
(equal? (format "~S" #rx"[a]aa") (format "~S" #rx"aaa")) ==> #f
I don't know that comparing whatever compiled automata or abstract
representations would be good enough to prove whether or not two regexps
are equivalent.
--
http://www.neilvandyke.org/