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
Cesar
Forum Commoner
Posts: 31 Joined: Sat May 22, 2004 1:35 am
Post
by Cesar » Thu Sep 09, 2004 2:28 am
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.
m3mn0n
PHP Evangelist
Posts: 3548 Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada
Post
by m3mn0n » Thu Sep 09, 2004 2:40 am
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
Post
by Cesar » Thu Sep 09, 2004 3:05 am
I like check string in one expression.
Can I or can not.
if i can while.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Sep 09, 2004 3:33 am
yes, you can check an entire string.
Cesar
Forum Commoner
Posts: 31 Joined: Sat May 22, 2004 1:35 am
Post
by Cesar » Thu Sep 09, 2004 3:46 am
how, can you explain?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Sep 09, 2004 4:19 am
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.