|
PHP and Regular Expressions 101
PHP has six functions that work with regular expressions. They all take a regular expression string
as their first argument, and are shown below:
ereg: The most common regular expression function,eregallows us to search a string for matches of a regular expression.ereg_replace: Allows us to search a string for a regular expression and replace any occurrence of that expression with a new string.eregi: Performs exactly the same matching asereg, but is case insensitive.eregi_replace: Performs exactly the same search-replace functionality asereg_replace, but is case insensitive.split: Allows us to search a string for a regular expression and returns the matches as an array of strings.spliti: Case insensitive version of the split function
This article originally appeared on WebReference.com.
| Comments: | ||
| ereg vs preg | Philippe Gamache | 06/05/07 09:51 |
|
If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly. | ||


