Server side validation (regular expression) syntax error, unexpected '/'

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
andyrav
User
Posts: 641

Server side validation (regular expression) syntax error, unexpected '/'

Post by andyrav »

Got a issue with "syntax error, unexpected '/'"
the line is
$this->useCustomOCP->addMethod("getServerValidateArguments", fn() => /^[10]+$/);
I dont have any validation on the field.
do you know what i should check for?

thanks


mobhar
User
Posts: 11724

Post by mobhar »

Are you using the older project in the latest PHPMaker version?


arbei
User
Posts: 9383

Post by arbei »

As said in the docs on Arguments (Server-side):
If Regular Expression, arguments must be the pattern to search for, as a single or double quoted string.


philmills
User
Posts: 551

Post by philmills »

I had something similar to this a few days ago, syntax error failed on a slash /

I found I hadn't enabled all required extensions in php.ini.
Also I regenerated all code and updated composer, after that the error went away.


Post Reply