PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon May 22, 2017 12:18 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Thu Jan 22, 2009 9:14 am 
Offline
Forum Regular
User avatar

Joined: Fri Apr 04, 2008 5:51 am
Posts: 779
GeertDD wrote:
d11wtq wrote:
Syntax: [ Download ] [ Hide ]
 
Character         Matching
 
. (dot)           ANY single character at all
 

Syntax: [ Download ] [ Hide ]
 
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:

Syntax: [ Download ] [ Hide ]
\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".

Syntax: [ Download ] [ Hide ]
\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"

Syntax: [ Download ] [ Hide ]
[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])"


Top
 Profile  
 
PostPosted: Thu Jan 22, 2009 9:16 am 
Offline
Forum Regular
User avatar

Joined: Fri Apr 04, 2008 5:51 am
Posts: 779
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...


Top
 Profile  
 
PostPosted: Tue Jan 27, 2009 9:02 pm 
Offline
DevNet Evangelist

Joined: Tue Dec 21, 2004 6:00 pm
Posts: 6267
Location: Winnipeg
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


Top
 Profile  
 
PostPosted: Wed Jan 28, 2009 1:23 am 
Offline
Forum Regular
User avatar

Joined: Fri Apr 04, 2008 5:51 am
Posts: 779
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.


Top
 Profile  
 
PostPosted: Thu Sep 24, 2009 1:47 am 
Offline
Forum Newbie

Joined: Mon Aug 24, 2009 2:24 pm
Posts: 22
simply awesome tutorial. I need that earlier. :)


Top
 Profile  
 
PostPosted: Sun Jan 23, 2011 1:16 pm 
Offline
Forum Newbie

Joined: Tue Nov 24, 2009 5:58 am
Posts: 5
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 ...!

_________________
MyWebSies: [url=worldhit.info]Sports News Update[/url]=>[url=gov2017.info]2017 Exams Result[/url]=>[url=projects-seminars.net]Seminars Project Reports Topic[/url]=>[url=reportdownload.info]Reports PPT pdf Abstracts[/url]


Top
 Profile  
 
PostPosted: Thu Aug 22, 2013 5:25 am 
Offline
Forum Newbie

Joined: Thu Aug 22, 2013 1:56 am
Posts: 15
excellent stuff thanks Chris.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 37 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group