Skip to content

Commit ebd4e3d

Browse files
committed
First release
1 parent 788d9fb commit ebd4e3d

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

README.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Regex-Assert-Symfony
22
Commun Regex to use with Assert in Symfony's entity
33

4-
## Email
5-
64
## Firstname Lastname City
75
Compatible with international names
86

@@ -16,7 +14,14 @@ Compatible with international names
1614
@Assert\Regex(pattern="/^[a-zA-ZàáâäãåąčćęèéêëėįìíîïłńòóôöõøùæúûüųūÿýżźñçÞčšžÀÁÂÄÃÅĄĆČĖĘÈÉÊËÌÍÎÏĮŁŃÒÓÔÖÕØÙÚÛÜŲŪŸÝŻŹÑßÇŒÆČŠŽ∂ð ,.'-]+$/u")
1715
```
1816

17+
### Lastname Firstname Examples
18+
19+
Mathias d'Arras
20+
Martin Luther King, Jr.
21+
Hector Sausage-Hausen
22+
1923
### City Examples
24+
2025
Toronto
2126
St. Catharines
2227
San Fransisco
@@ -35,3 +40,35 @@ Compatible with international names
3540
Sauðárkrókur
3641
Þorlákshöfn
3742

43+
## Postal code
44+
Compatible with international country code
45+
46+
### Pattern
47+
```
48+
/^[0-9 ,.-]+$/
49+
```
50+
51+
### Usage
52+
```
53+
@Assert\Regex(pattern="/^[0-9 ,.-]+$/")
54+
```
55+
56+
### Examples
57+
58+
1234
59+
69001
60+
12-3456
61+
1234-5678
62+
63+
## Email
64+
It's recomended to use the string constraints [Email](http://symfony.com/doc/current/reference/constraints/Email.html)
65+
66+
### Usage
67+
```
68+
/**
69+
* @Assert\Email(
70+
* message = "The email '{{ value }}' is not a valid email.",
71+
* checkMX = true
72+
* )
73+
*/
74+
```

0 commit comments

Comments
 (0)