Bug #91340

RegEx validator in EXT:form does not support negative lookbehind

Added by Peter Kraume 7 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Form Framework
Start date:
2020-05-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I tried to use this regular expression to allow all email addresses but not those ending with @qq.com:

/^.+@.+(?<!@qq.com)$/g

There are two problem with the regex validator of EXT:form when you want to use an expression with negative lookbehind:

1. The GUI of the TYPO3 backend cuts the regular expression when there is a < in the expression.
2. Even if you edit the yaml file in the file system and enter the expression manually, you end up with the following exception:

TYPO3\\CMS\\Extbase\\Validation\\Exception\\InvalidValidationOptionsException: regularExpression \"/^.+@.+(?<!@qq.com)$/g\" in RegularExpressionValidator contained an error. in /var/www/html/public/typo3/sysext/extbase/Classes/Validation/Validator/RegularExpressionValidator.php:51

No data to display

Also available in: Atom PDF