List of Regular Expressions

Regular expressions are the one of the primary function. Which is required in almost every php project.
So, here are the list of most used

1. /[^a-zA-Z0-9.]/
For alphabet, numbers.

2. /^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/
For email address

3. |^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i
For website url

4. /^[A-Za-z0-9_- ]+$/
Alpha numeric, dashes, underscores and spaces

5. [^0-9A-Za-z]
Any symbol (not a number or a letter)

6. [A-Za-z0-9]
Any letter or number

7. [A-Za-z]
Any letter

Share On

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*