Regular Expression Generator

Regular Expression Generator

am 26.06.2006 07:42:49 von jeremyje

Is there a library or a way to generate an appropriate regular
expression for any given input string?
(remove quotes for examples)
For example: "1234567890abcdef is in hex9"
Regex Generator returns: [0-9|A-F]{16} [a-z]{2} [a-z]{2} [0-9|a-z]{3}

Or anything that does some sort of similar processing?

Re: Regular Expression Generator

am 26.06.2006 20:52:48 von Ted Zlatanov

On 26 Jun 2006, jeremyje@gmail.com wrote:

> Is there a library or a way to generate an appropriate regular
> expression for any given input string?
> (remove quotes for examples)
> For example: "1234567890abcdef is in hex9"
> Regex Generator returns: [0-9|A-F]{16} [a-z]{2} [a-z]{2} [0-9|a-z]{3}
>
> Or anything that does some sort of similar processing?

I only know of this one:

http://search.cpan.org/~dankogai/Regexp-Optimizer-0.15/lib/R egexp/Optimizer.pm

Emacs also has a regexp-opt function you may find interesting (as an
alternate approach in a different language).

Ted