PHP - Regular Expression

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
Cesar
Forum Commoner
Posts: 31
Joined: Sat May 22, 2004 1:35 am

PHP - Regular Expression

Post by Cesar »

Hi.
What can i check string in one expression.
"^[1-9][0-9]*$" and "^[0-9]+(-[0-9]+){1,2}$" expressions to marge and create the one expression.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Can you explain more clearly what exactly your problem is, and what you want to accomplish? Thanks.


PHP Manual Info: [php_man]regex[/php_man]
Cesar
Forum Commoner
Posts: 31
Joined: Sat May 22, 2004 1:35 am

Ok

Post by Cesar »

I like check string in one expression.
Can I or can not.
if i can while.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

yes, you can check an entire string.
Cesar
Forum Commoner
Posts: 31
Joined: Sat May 22, 2004 1:35 am

Post by Cesar »

how, can you explain?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

your regexes have starting and ending anchors.. that tells the engine to match the entire string. any more explaination, and we'll need to know what you want to match.
Post Reply