Simplification of regular expression

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 4K views
-A-
Messages
5
Reaction score
0
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.
 
Physics news on Phys.org
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.