Just came up with a simple plan for a fairly powerful math function.
Can someone help me setup an expression that will test whether or not
$value consists of any characters beside numbers . + - * /  (others
will be added if you want more capabilities--via an sdv definition)

Here's what I have but it fails the simple test of 1+2

        if ( ! ereg("/0-9\\.\\+\\-\\*\\//", $value)) $m .= "Invalid numeric 
input. ";
also  if (!ereg("/^[0-9|\\.|\\+|\\-|\\*| |\\/]+$/", $value)) $m .=
"Invalid numeric input. ";

Not sure what I'm doing wrong... Just want it air tight since I'll be
using eval for this...

Cheers,
Dan

_______________________________________________
pmwiki-users mailing list
[email protected]
http://www.pmichaud.com/mailman/listinfo/pmwiki-users

Reply via email to