Skip to content

[SYMFONY73] replace regex to new Slug constraint #723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JohJohan opened this issue Apr 29, 2025 · 1 comment · May be fixed by #780
Open

[SYMFONY73] replace regex to new Slug constraint #723

JohJohan opened this issue Apr 29, 2025 · 1 comment · May be fixed by #780

Comments

@JohJohan
Copy link
Contributor

I saw https://symfony.com/blog/new-in-symfony-7-3-slug-and-twig-constraints#slug-constraint where we have a Slug constraint we can replace regex's constrants that have /^[a-z0-9]+(?:-[a-z0-9]+)*$/ with slug constraint. Might be a specific replacement but maybe worth it?

I see its used public 25 times: https://github.com/search?q=%23%5BAssert%5CRegex%28%27%2F%5E%5Ba-z0-9%5D%2B%28%3F%3A-%5Ba-z0-9%5D%2B%29+*%24%2F%27%29%5D&type=code

@TomasVotruba
Copy link
Member

Sounds good. Can you send the rule? 👍

@JohJohan JohJohan linked a pull request May 20, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants