I often generate regexes on the fly. Have a look at the
regex that matches URLs at
http://www.foad.org/~abigail/Perl/url3.regex,
which was generated by the program found at
http://www.foad.org/~abigail/Perl/url3.pl.
And then there's the Regexp::Common module as found on CPAN.
Many of its regexes are generated.
Abigail