Pattern Syntax Question?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Mds
Forum Contributor
Posts: 110
Joined: Tue Apr 22, 2008 8:56 pm
Contact:

Pattern Syntax Question?

Post by Mds »

Hi.
What's the meaning of - character in PHP's Pattern Syntax ? Image

Thanks in advance.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Pattern Syntax Question?

Post by Christopher »

Not sure what PHP's pattern matching. PHP uses regular expressions. '-' is for a range of characters, so /[a-z]/ matches any lower case character.
(#10850)
User avatar
Mds
Forum Contributor
Posts: 110
Joined: Tue Apr 22, 2008 8:56 pm
Contact:

Re: Pattern Syntax Question?

Post by Mds »

Thank you Image
User avatar
The_Anomaly
Forum Contributor
Posts: 196
Joined: Fri Aug 08, 2008 4:56 pm
Location: Tirana, Albania

Re: Pattern Syntax Question?

Post by The_Anomaly »

If you're doing extensive work with regex, you might want to check out this reference. It's a nice compilation of the patterns and symbols used.
Post Reply