SiteMinder / Webhosting
The Computer Merchant, Ltd
US-MA-North Quincy

Justtechjobs.com Post A Job | Post A Resume

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, ereg allows 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 as ereg, but is case insensitive.
  • eregi_replace: Performs exactly the same search-replace functionality as ereg_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.


[Page 1]  [Page 2]  


Comments:
ereg vs pregPhilippe Gamache06/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.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.