Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

Regular expression question

General discussions related to php

Moderators: macek, egami, gesf

Regular expression question

Postby CorellonElven » Sun Sep 28, 2003 3:39 am

Hi

I know this is a bit of topic but its still somewhat php related.

I am having difficulties with building the correct regular expression against which I test the input string with eregi function I need to check if the string i receive consists only of allowed characters and the square brackets [ ] something like that "^[0-9=+-]+$") plus those square brackets.
As far as I know I need to make this expression like this
"^[0-9=\[\]+-]+$") so I check if the string consists of one or more allowed characters.

This part of the expression is wrong \[\] (square brackets within square brackets)

What is the correct regular expression to match this pattern.

Thanks a lot.
CorellonElven
New php-forum User
New php-forum User
 
Posts: 3
Joined: Sun Aug 31, 2003 2:32 am

Postby Redcircle » Sun Sep 28, 2003 10:46 pm

I would suggest preg..

reg expressions are not my forte but the docs in the preg fucntions are very helpful when I need to use one.
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA


Return to PHP General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.