Exalted ones:

I have been attempting to get a firm grasp on the ins and outs of simplifying regular expressions. I have come to some conclusions on my own, but am wondering if there is some font of wisdom I can tap into on my way to the path of regex enlightenment.

My latest discovery was the list of pages that I Googled for "regular expression algebraic laws"https://www.google.com/search?q=regular+experession+algebra&sourceid=ie7&rls=com.microsoft:en-US:IE-Address&ie=&oe=&safe=active&gws_rd=ssl#safe=active&q=regular+expression+algebraic+laws. When these talk about Regular Expressions, are they talking about the exact same type of Regexes that we spend so much time talking about?

It would appear that the laws that they mention in these pages would apply to the Regexes we so dearly love, with some caveats or questions:

The Commutative Law would need a slight modification. They say L+M=M+L, or LUM=MUL, or L|M=M|L. This would almost be true the way we handle things except for the left-most, longest rule.

Not having had a course in Regular Expressions or Finite Automata or such, what does ɛ correspond to in our usage? I assume that Ø means empty set or no results.

Are there some scrolls somewhere that I may read to become enlightened? Some website of wonderful wisdom?

Many thanks


In reply to Simplifying regexes by ExReg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.