Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Simplification of regular expression

  1. Sep 9, 2010 #1


    User Avatar

    So is there any set of defined rules that help in the simplification of regular expressions?

    Because till now I would simply try and look at the patterns and see whether this or that simplified version would generate the same.Intuitive, but now always fast or correcct.

    So is there any general way to go about this...or anyone know any resources I can read up on this?

  2. jcsd
  3. Sep 10, 2010 #2
    Interesting question -- I've never run into anything like that.

    I have a hard time imagining it existing, except for "obvious" redundancies. If you think of it kind of like an algebra, the "input space" that the regex is operating on is going to change depending on the inputs, so sometimes one reduction would work and other times it won't. Once you assume that anything can be sent in, then only pretty straight forward redundancies are left.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook