[pmwiki-users] Data storage project

Martin Fick mogulguy at yahoo.com
Sun Jul 30 17:13:45 CDT 2006


--- The Editor <editor at fast.st> wrote:
> 2) I'm trying to do some data proofing of the data
> storage recipe by
> making sure field values only have acceptable
> characters.
> Unfortunately, this line does not seem to be working
> properly as other
> symbols are getting through:
> 
> 		   if (ereg("[A-Za-z0-9 :.?()-]",$value)) {
> 
> Do some of those symbols have special meaning
> messing up this function in ereg?
> 

Are you trying to match only strings made up of only
those characters?  If so, I think that you want to
form a regexp that matches a complete line, note the
anchors and the * which means 0 or more of the
previous symbol(s):

 if (ereg("^[A-Za-z0-9 :.?()-]*$",$value)) {


-Martin


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the pmwiki-users mailing list