APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

2004/11/15 regex


Some material is very old and may be incorrect today

© November 2004 Tony Lawrence

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 http://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.


If you found something useful today, please consider a small donation.



Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

->
-> regex


Inexpensive and informative Apple related e-books:

Take Control of Preview

Take Control of Automating Your Mac

Take Control of iCloud

Photos for Mac: A Take Control Crash Course

Photos: A Take Control Crash Course





More Articles by © Tony Lawrence





Printer Friendly Version

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





A crowded police docket is the surest of all signs that trade is brisk and money plenty. (Mark Twain)




Linux posts

Troubleshooting posts


This post tagged:

Perl

Programming

Scripting

UnixWords



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode