PDA

View Full Version : Learning RegExp



fgay trader
03-07-2002, 11:07 AM
Ok, I was trying to make some alerts in SEQ and after utter failure realized that I really need to learn Regular Expressions.

Any idea where to start? Are there any good Internet resources with understandable explanations and examples? Any books someone can recommend?

See - SEQ actualy encourages learning!


- FGay Trader er... GFay :D

Yueh
03-07-2002, 11:56 AM
'man perlre' is actually helpful believe it or not. Perl has gone and completely soiled the reputation of Unix man pages as obfuscated beyond all comprehension :)

Mr Guy
03-07-2002, 12:41 PM
Learning Regex through the eyes of perl is definitely the way to go, imho.


Check www.perl.com as well, and the documentation for regular expressions. If you want to go the thorough (read: not free) route, O'Rielly has a book on regex. (http://www.oreilly.com/catalog/regex)

fgay trader
03-07-2002, 04:56 PM
Thanks for the info, Mr Guy! I loked at the book's description and it hints that the book puts alot of emphasis on Perl. If I'm not familliar with Perl at all, will the book still be helpful?

I am a programmer though, I work with Visual Basic and PowerBuilder (/em ducks from the Windoze CD's thrown at him) and am looking into .NET (which also had RegEx support via libraries.) So if someone can recommend RegEx resources that are a bit closer to that environmet, it would be much appreciated.


-FGay Trader er... GFay :D

Mr Guy
03-08-2002, 07:48 AM
It is my general experience that almost all regex's follow the regex's PERL uses. Now whether that's because PERL is based on some standard they are really following, I don't know. At any rate, SEQ evaluates the same as PERL, and everyone should be forced to learn PERL when they learn to read in grade school.

So yes, besides the help it will give you with SEQ, you should learn PERL and the associated regular expressions to make yourself a better person.

high_jeeves
03-08-2002, 09:31 AM
I decided to expand my mind and learn pearl about 3 years ago. It is a very useful language, and takes about 3 days to learn (The O'Rielly books are excellent). I highly recommend that you learn it. The way PERL uses regex is based on another standard (although I dont remember where it comes from exactly), but PERL has the best treatment of regex, and makes it the easiest to learn.

--Jeeves

Mr Guy
03-08-2002, 10:29 AM
It's very similiar to sed, maybe that's it?
Are regular expressions covered by POSIX standards?

PERL originally got it's regex from Henry Spencer's regular expression package. I only know that from the camel book. I have no idea who Heny Spencer is.

Yueh
03-08-2002, 10:39 AM
BSD has a regex standard, POSIX has a regex standard, GNU has a regex standard. I'm assuming, at least to the level used by most, they are compatible and this is where the pseudo-standard lies.