Page 3 of 3

Re: (a) Regex CRASH Course! (Pt. 1)

Posted: Thu Jan 22, 2009 8:14 am
by prometheuzz
GeertDD wrote:
d11wtq wrote:

Code: Select all

 
Character         Matching
 
. (dot)           ANY single character at all
 

Code: Select all

 
Modifier         Effect
 
s                Ignore whitespace
 
Note that the above is not quite true.

The dot metacharacter does match any single character except for newlines.

I don't know exactly what you mean by 's modifier ignores whitespace'? Anyway, the s modifier just changes the meaning of the dot metacharacter which will then match newlines as well. Agree?
You're right of course Geert. Note that the author's "ignores white space (in the regex)" remark should belong to the x-modifier.

Some more inaccuracies:

Code: Select all

\d, \s etc are what we refer to as "metacharacters"
Should be '\d, \s etc are what we refer to as "short hand character classes"'. Meta characters are: ., *, (, {, [, etc.
\d is a shorthand for [0-9], and [0-9] is a character class (or character set), hence: "short hand character class".

Code: Select all

\w Any single alphanumeric character (a-z, 0-9) and underscores
Should be: "\w Any single alphanumeric character (a-z, A-Z, 0-9) and underscores"

Code: Select all

[x-y] Any single character in the range x to z (e.g. [A-Z])
A typo, I presume: this should be "[x-y] Any single character in the range x to y (e.g. [A-Z])"

Re: (a) Regex CRASH Course! (Pt. 1)

Posted: Thu Jan 22, 2009 8:16 am
by prometheuzz
batfastad wrote:This is a great tutorial. I refer to it all the time.

However I think I've found one slight inaccuracy regarding the s modifier which could be updated.

...
Geert already mentioned that. But I don't think this tutorial is updated anymore since is has last been updated in 2005...

Re: (a) Regex CRASH Course! (Pt. 1)

Posted: Tue Jan 27, 2009 8:02 pm
by alex.barylski
Chris...this is probably the best regex resource I have ever found...I refer to this more than anything when it comes to regex...

The only exception would be when I had to support Unicode...have you considered re-writting it to cover Unicode techniques?

Here is a useful resource I have also used several times:

http://www.regular-expressions.info/unicode.html

Cheers,
Alex

Re: (a) Regex CRASH Course! (Pt. 1)

Posted: Wed Jan 28, 2009 12:23 am
by prometheuzz
PCSpectra wrote:Chris...this is probably the best regex resource I have ever found...I refer to this more than anything when it comes to regex...
It would have been better if the errors were removed from it.
PCSpectra wrote: Here is a useful resource I have also used several times:

http://www.regular-expressions.info/unicode.html
That is a better resource, IMHO.

Re: (a) Regex CRASH Course! (Pt. 1)

Posted: Thu Sep 24, 2009 1:47 am
by soul_fly
simply awesome tutorial. I need that earlier. :)

Re: (a) Regex CRASH Course! (Pt. 1)

Posted: Sun Jan 23, 2011 12:16 pm
by remshad
prometheuzz wrote:
batfastad wrote:This is a great tutorial. I refer to it all the time.

However I think I've found one slight inaccuracy regarding the s modifier which could be updated.

...
Geert already mentioned that. But I don't think this tutorial is updated anymore since is has last been updated in 2005...
definitely i also loved this tutorial ...!

Re: (a) Regex CRASH Course! (Pt. 1)

Posted: Thu Aug 22, 2013 5:25 am
by akhilesh1010
excellent stuff thanks Chris.

Re: (a) Regex CRASH Course! (Pt. 1)

Posted: Tue Aug 08, 2017 3:48 pm
by hybris
Chris, if i were a girl I'd wanted you as father of my children :D

Thanks, excellent crash course! Finally I understand (or atleast think I understand) some of how the patterns work. Very helpful!

Cheers :)