PHP Regular Expressions

Notes:

A regular expression is enclosed between two forward slashes “//“. Hash signs # or tildes ~ can also be used (these characters are called delimiters).
eg. $exp = “/php/“;    – search for the occurence of string ‘php’

Special/meta-characters:

* Match zero or more of the preceding expression
Match one or more occurences of the preceding expression
? Match zero or one of the preceding expression

() brackets can be used to mark out sub patterns.

 

This entry was posted in computing, web development. Bookmark the permalink.