[pmwiki-devel] Math pattern matching glitch
The Editor
editor at fast.st
Tue Mar 20 13:24:26 CDT 2007
On 3/20/07, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Tue, Mar 20, 2007 at 02:11:03PM -0400, The Editor wrote:
> > Also, I still can't seem to get this pattern to match properly...
> >
> > $ZAPmath = "/^[-+*/% ()0-9.]+$/";
> > if (! preg_match($ZAPmath, $value)) $m .= "Invalid numeric input. ";
> >
> > It returns very unpredictable results. Can't seem to get it right...
>
> You might need to escape the slash that occurs in the middle,
> or use some character other than slashes as the delimiter:
>
> "/^[-+*\\/% ()0-9.]+$/"
>
> "!^[-+*/% ()0-9.]+$!"
>
> Pm
Thank you, again!
Cheers,
Dan
More information about the pmwiki-devel
mailing list