PDA

View Full Version : Simplification of regular expression


-A-
Sep9-10, 04:45 PM
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?

Thanks.

diggy
Sep10-10, 03:44 PM
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.