PHP regular expression allows programmer to perform various task like comparing, finding and replacing a particular type of strings. Using Regular expression one can easily validate user form or perform complex manipulations between strings.
PHP Regular expression also allows you to validate a email, phone numbers and zip codes etc. In short we can say that it is a pattern-matching functionality that allows you to match, find, replace or divide strings in small chunks.
There are basically two types of PHP Regular Expression.
- POSIX Regular Expressions
- PERL Style Regular Expressions
PHP Examples