Regular Expression. The type of pattern matching you do with sed or grep or Perl uses regexes.
There are whole books on regular expressions. I imagine most of us have some degree of familiarity, but this can be a very complex subject. Larry Wall (originator of Perl) hit the nail on the head when he said
Regexes aren't strings, they're programs. Or, rather, they're strings only in the sense that any piece of program is a string
So, in the Perl world, regex's will undergo a major transformation with Perl 6. Larry (a bit of a religious nut) describes the changes in Perl 6 as an Apocalypse. Don't get too worried: Larry promises
It is my fond hope that those who are fond of Perl 5 will be fonder still of Perl 6
But back to regexes. You'll find the gory details of Larry's thoughts on regexes, what's wrong, what needs to be changed, and more, at https://www.perl.com/pub/a/2002/06/04/apo5.html. If you use Perl, you'll want to read that. Again, Larry warns you:
Given all this, I need to warn you that this Apocalypse is going to be somewhat radical. We'll be proposing changes to certain "sacred" features of regex culture, and this is guaranteed to result in future shock for some of our more conservative citizens. Do not be alarmed. We will provide ways for you to continue programming in old-fashioned regular expressions if you desire. But I hope that once you've thought about it a little and worked through some examples, you'll like most of the changes we're proposing here.
If Larry's expository style isn't quite your cup of tea (I enjoy reading it, but not everyone agrees), you might try Perl 6 grammars and regular expressions for another view of the changes coming.
Got something to add? Send me email.
More Articles by Tony Lawrence © 2011-07-06 Tony Lawrence
Simplicity is prerequisite for reliability. ((Edsger W. Dijkstra)
Printer Friendly Version
regex: Tech Words of the Day Copyright © November 2004 Tony Lawrence
Have you tried Searching this site?
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.
Contact us
Printer Friendly Version