in reply to Simplifying regexes
As other monks have pointed out, Perl's regular expressions are indeed anything but regular in the formal sense. Formal regular expression use only the following operations:
If you want to wrap your head around what these regular expressions really mean, though, it's best to start with formal languages, specifically regular languages. Regular expressions describe these languages in a very natural and obvious manner.
That said, while fascinating, none of this will help a lot with simplifying Perl regular expressions in a Perl program. For that, you'll need a good intuition of how regular expressions work in Perl, and for that you'll simply have to use them, time and again.
If you're not getting along with Mastering Regular Expressions, BTW, the chapter on regular expressions in Programming Perl is eminently readable and accessible.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Simplifying regexes
by ExReg (Priest) on Oct 26, 2015 at 17:23 UTC | |
by Laurent_R (Canon) on Oct 26, 2015 at 17:56 UTC | |
by AnomalousMonk (Archbishop) on Oct 27, 2015 at 08:55 UTC | |
|
Re^2: Simplifying regexes
by locked_user sundialsvc4 (Abbot) on Oct 26, 2015 at 17:27 UTC |