PHP RegEx: Search and match text using regular expressions.

Recommend this page to a friend!
  Info   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 643 All time: 4,894 This week: 232Up
Version License PHP version Categories
regex 1.0.1GNU General Publi...5PHP 5, Text processing
Description Author

This class can be used to search and match text using regular expressions.

It provides several static functions that can be used to perform several types of operations with text strings and regular expressions.

Currently it can test if a regular expression is valid, find if a text matches one or more regular expressions, replace parts of a text string that match a regular expression, split a string using a regular expression to define the separator format, count words in a string separated by white spaces.

The class has several static variables with pre-defined regular expressions for matching text in common formats like: white space, line breaks, alphabetic strings, numeric strings, hexadecimal strings, US social security numbers, US zip codes, US states, US dollar amounts, date and time, file paths, Mac and IP addresses, URLs, email addresses, HTML tags, CSS identifiers, MIME types, mobile user agents, etc..

Picture of Ore Richard Muyiwa
  Performance   Level  
Name: Ore Richard Muyiwa <contact>
Classes: 6 packages by
Country: Nigeria Nigeria
Age: 27
All time rank: 13814 in Nigeria Nigeria
Week rank: 487 Up9 in Nigeria Nigeria Down
Innovation award
Innovation award
Nominee: 3x



With RegEx, you can find ready-made full functioning regex solutions to many thing we usually struggle to "regex". It is a good replacement for php preg. It provides an interface to test a regex, perform match, replace, perform a deep replace, split a string, count words in a string, find ocuurences of a regex in anything(e.g. find a url in an email), perform a javascript-like regex.test() function.

  Files folder image Files  
File Role Description
Plain text file regex.php Class Main class
Accessible without login Plain text file Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:4,894
This week:232Up

For more information send a message to info at phpclasses dot org.