Regular Expression | Description | Use Case |
---|
[0-9]{5} | Only digits and exactly five digits are accepted.
| Validate a German zip code.
|
[0-9/ -]* | The field may only contain (any number of) digits, slash, space and minus sign, or it may be blank. | Check the input of phone numbers. |
[A-Za-z0-9]+ | Only letters and numbers are allowed. | Prevent usage of special characters in the input. |
[a-zA-Z0-9 öäüÖÄÜ §%&]* | Allowed input: Any number of upper and lower case letters, digits, umlauts and the special characters §, %, & are permitted. | Suitable for checking a password that may only contain the special characters specified in the regular expression. |
[a-zA-Z0-9§%&]{8,16} | Allowed input: Upper and lower case letters (but no umlauts), digits and the special characters §, %, &. And the input must consist of at least 8, but not more than 16 characters. | Suitable for checking a password that may only contain the special characters specified in the regular expression and must have a certain length. |
[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-z]{2,} | Allowed input: - String (containing letters, digits, dot, underscore or minus) followed by an @-sign and another string (containing letters, digits, dot, underscore or minus) followed by a dot and two or more letters.
| Validate the input of an email address. |
(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)? | Allowed input: - URL with prefix http://
- URL with prefix https://
- URL without prefix
| Checks if the input contains a valid URL. |