Project

General

Profile

Actions

Feature #23633

open

regex in TCA eval function

Added by Robert Heel over 13 years ago. Updated 10 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2010-09-28
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.2
Tags:
Complexity:
Sprint Focus:

Description

Would be nice to use regex in eval to check values of input fields.

With the attached patch you can use
'eval' => 'trim,lower,/[a-z0-9 _-]*/'
in your TCA configuration.

http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.3.0/view/4/2/#id2520906

(issue imported from #M15836)


Files

eval_regex.diff (967 Bytes) eval_regex.diff Administrator Admin, 2010-09-28 19:04
Actions #1

Updated by Steffen Kamper over 13 years ago

indeed no bad idea, but i wouldn't do it this way. it depends on delimiter = / and doesn't allow modifiers.

This syntax i would prefer: regex(/any expression/any modifier)

Actions #2

Updated by Robert Heel over 13 years ago

Thanks! The patch already allows a modifier (search for / at last and next to last position). Existing expressions also not function-style - so I have chosen this syntax.

Actions #3

Updated by Alexander Opitz almost 9 years ago

  • Description updated (diff)
  • Category set to Backend API
  • Target version deleted (0)
Actions #4

Updated by Sybille Peters about 6 years ago

Thank you for your report.

Even though it has been some time, would you consider checking if your patch idea is still up to date and upload it to our Gerrit review server?

Someone could do this for you, but I am thinking you might like the opportunity to contribute to TYPO3 yourself.

You can find a description of the TYPO3 contribution workflow here: https://docs.typo3.org/typo3cms/ContributionWorkflowGuide/

Hint: If you get stuck anywhere, ask on Slack in the #typo3-cms-coredev channel. You can register in the TYPO3 slack workspace here: https://forger.typo3.com/slack

Thank you in advance!

Actions #5

Updated by Julian Hofmann about 6 years ago

It is still a nice feature (and we need it actually).

This syntax i would prefer: regex(/any expression/any modifier)

Thinking about a better syntax, my idea was to have a look at extbase validators syntax. In my opinion, it would be nice to have consistent syntax for same properties in a project/software.
Extbase uses e.g.: regularExpression(regularExpression="/^[0-9]{5}$/")

@Robert Lemke: Currently the patch would only allow modifiers which consists of one single character

Actions #6

Updated by Gerrit Code Review about 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68762

Actions #7

Updated by Gerrit Code Review about 3 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68762

Actions #8

Updated by Gerrit Code Review about 3 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68762

Actions #9

Updated by Gerrit Code Review about 3 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68762

Actions #10

Updated by Gerrit Code Review about 3 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68762

Actions #11

Updated by Gerrit Code Review about 3 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68762

Actions #12

Updated by Gerrit Code Review over 2 years ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68762

Actions #13

Updated by Gerrit Code Review almost 2 years ago

Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68762

Actions #14

Updated by Benni Mack 10 months ago

  • Status changed from Under Review to New
Actions

Also available in: Atom PDF