I got this error message while trying to create validation using "Regular Expression".
Please tell me where I did wrong, or someone please tell me any other way to write this Regex.
Regex code: |/^\d[A-L][A-GZ][A-Z][0A-Z]\d\d\d\d\d/|
Test String: 8LAT000001
I get this error as shown below;
Warning: preg_match() [function.preg-match]: Unknown modifier '^' in webform_validation_webform_validation_validate() (line 370
Thanks in advance.
Comments
Comment #1
Bright Web Design commentedWarning: preg_match() [function.preg-match]: Unknown modifier '^' in webform_validation_webform_validation_validate() (line 370 of C:\xampp\htdocs\drupal7\sites\all\modules\webform_validation\webform_validation.validators.inc).I forgot to add full error, here it is.
Comment #2
svendecabooterHi,
The pattern delimiters are already in the code itself.
So the regex code you enter should be just
^\d[A-L][A-GZ][A-Z][0A-Z]\d\d\d\d\dHowever there could be a case where there are still characters after the pattern delimiters (e.g.
/regex/ifor case insensitive search), so that's posing a problem right now. But if I change that behavior, an upgrade path & clear explanation should be provided.I'll have to think about the best approach for that...
Comment #3
svendecabooterComment #4
svendecabooterActually we use mb_ereg(), which doesn't need delimiters.
I have updated the validation rule help text to make clear that delimiters shouldn't be added.