Search code examples
regexminimization

Programs/Calculators to Minimize Regular Expressions


I was just wondering if there is any free software out there that is able to effectively minimize regular expressions.


Solution

  • You see this question being asked a lot but I haven't seen an effective one anywhere. If you think though the logic required just to simplify something simple like character ranges in a character class - and the fairly low value of doing something like that I think the lack of these begins to make sense.

    As another example, how do you remove unneeded groupings when you don't know how they might be used in a replacement string. I would think any simplification that could be achieved would be mostly superficial.

    This guy wrote one in Haskell but didn't share: http://community.haskell.org/~ndm/resimplify/

    (PS: I sort of lied - there is one effective Regex simplification tool... The mechanical turk that is Stack Overflow :)