55
66 The ``Slug `` constraint was introduced in Symfony 7.3.
77
8- Validates that a value is a slug.
9- A slug is a string that, by default, matches the regex ``/^[a-z0-9]+(?:-[a-z0-9]+)*$/ ``.
8+ Validates that a value is a slug. By default, a slug is a string that matches
9+ the following regular expression: ``/^[a-z0-9]+(?:-[a-z0-9]+)*$/ ``.
1010
1111.. include :: /reference/constraints/_empty-values-are-valid.rst.inc
1212
@@ -19,7 +19,7 @@ Validator :class:`Symfony\\Component\\Validator\\Constraints\\SlugValidator`
1919Basic Usage
2020-----------
2121
22- The ``Slug `` constraint can be applied to a property or a " getter" method:
22+ The ``Slug `` constraint can be applied to a property or a getter method:
2323
2424.. configuration-block ::
2525
@@ -77,14 +77,14 @@ The ``Slug`` constraint can be applied to a property or a "getter" method:
7777 }
7878 }
7979
80- Examples of valid values :
80+ Examples of valid values:
8181
8282* foobar
8383* foo-bar
8484* foo123
8585* foo-123bar
8686
87- Upper case characters would result in an violation of this constraint.
87+ Uppercase characters would result in an violation of this constraint.
8888
8989Options
9090-------
@@ -94,8 +94,8 @@ Options
9494
9595**type **: ``string `` default: ``/^[a-z0-9]+(?:-[a-z0-9]+)*$/ ``
9696
97- This option allows you to modify the regular expression pattern that the input will be matched against
98- via the :phpfunction: `preg_match ` PHP function.
97+ This option allows you to modify the regular expression pattern that the input
98+ will be matched against via the :phpfunction: `preg_match ` PHP function.
9999
100100If you need to use it, you might also want to take a look at the :doc: `Regex constraint <Regex >`.
101101
0 commit comments