PHP Classes

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    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-10 (4 months ago) RSS 2.0 feedNot enough user ratingsTotal: 694 All time: 4,714 This week: 673Up
Version License PHP version Categories
regex 1.0.10GNU General Publi...5PHP 5, Text processing


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: 30
All time rank: 13134 in Nigeria Nigeria
Week rank: 84 Up5 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,714
This week:673Up