- Issue created by @DamienMcKenna
- πΊπΈUnited States DamienMcKenna NH, USA
The problem was that the regex strings needed prefix and suffix slashes, but the UI didn't make that clear, once I added the slashes it worked as expected.
- πΊπΈUnited States DamienMcKenna NH, USA
Turning this around to focus on improving the UI, it was user error that could be guarded against rather than a bug in the module.
- πͺπΈSpain pcambra Asturies
100% agreed with this, regex validators should be... validated, both indicating the format expected and preventing saving the wrong format. Or just removing the need to append the slashes.
- π©πͺGermany marc.bau
I guess I had the same issue here...
Migrated several regex rules from D7 to D10 and wondered why they all erroring with
preg_match(): No ending delimiter '^
. But https://stackoverflow.com/questions/4634993/php-regular-expressions-no-e... provided the solution. The D10 module requires leading and trailing slashes!Example - Telephone number validation:
D7:
^(?:(\+\d{1,2})\s(?:\(\d{1,}\))\s(?:\d+[-.\s]?+)\d{1,})$
D10
/^(?:(\+\d{1,2})\s(?:\(\d{1,}\))\s(?:\d+[-.\s]?+)\d{1,})$/
Is this an intentional change or a defect in the module?