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
2021-11-22 (4 days ago) RSS 2.0 feedNot enough user ratingsTotal: 651 This week: 14All time: 4,884 This week: 20Up
Version License PHP version Categories
regex 1.0.2GNU 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: 28
All time rank: 13324 in Nigeria Nigeria
Week rank: 24 Up2 in Nigeria Nigeria Up
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:14
All time:4,884
This week:20Up
For more information send a message to info at phpclasses dot org.