0

I was wondering if any of you guys know of a good tutorial on regex. I'm able to do most of the simple stuff, but still confused by some of the more advanced pattern matching.

3
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by ~s.o.s~
0

Do you know if there's a difference between perl-compatible regex and php-compatible regex (which is what I use)?

0

PHP's ereg regexes use the POSIX Extended regex features, which are described decently at http://en.wikipedia.org/wiki/Regular_expression These pretty much form a subset of Perl-compatible regex features -- Perl-compatible regexes support lazy matching, like (foo)*? , and have more codes for convenient things like digits with \d and word boundaries with \b and such. According to the PHP manual, the POSIX Extended regex library, when used with PHP strings, aren't binary safe and will not match past a nul character placed in the string, and the perl-compatible version (available in PHP with functions whose names begin with "pcre_") has a faster implementation anyway.

0

I'm incredibly confused by what you just said but I'll take your word for it that if I read all of these tutorials that, by the end, I'll have a much clearer understanding :)

Thanky :)

Cheers

0

> I'm incredibly confused by what you just said but I'll take your word for it that if I read all of
> these tutorials that, by the end, I'll have a much clearer understanding

You shouldn't be; the basics as well the pretty advanced stuff remains more or less the same. My recommendation would be the book 'Mastering Regular Expressions' which is a must read for all those who want to be regex gurus.

Though the basics are the same, the application of regular expressions depends a lot on the language you use, so unless you consult your language documentation, you might be in for a big surprise. :-)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.