PHP Classes

Regexp Builder: Build regular expressions programmatically

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 72%Total: 2,700 All time: 1,409 This week: 673Up
Version License PHP version Categories
regexp-builder 1.0GNU Lesser Genera...4.2PHP 5, Tools, Text processing
Description 

Author

This class can be used to build regular expressions programmatically.

It provides clearly named functions to add each part of a regular expression, such as matching the beginning or end of the text, match a range of characters, match any text, match a portion of text multiple times, capture a portion of the text, etc..

The resulting regular expression can be applied on a given text string to match.

Changelog:
1.0
- Added replaceWith, replaceWithCallback, split and grep methods
- Fixed bug on characters escape
- Added 6 more tests

0.2
- Fixed bug on conditions using PRECEEDED_BY and NOT_PRECEEDED_BY
- Added 2 more tests

0.1
- first release

Innovation Award
PHP Programming Innovation award nominee
November 2009
Number 3


Prize: One year subscription to the PDF edition of the JSMag magazine
Regular expressions are often used to match text expressions that follow an expected syntax.

However, the syntax of regular expressions is not very trivial to most developers.

This class provides a very developer friendly way to build regular expressions.

Manuel Lemos
Picture of Marco Marchiò
  Performance   Level  
Innovation award
Innovation award
Nominee: 2x

 

  Files folder image Files (18)  
File Role Description
Files folder imagetests (16 files)
Plain text file regexpBuilder.php Class Class
Accessible without login HTML file documentation.html Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:2,700
This week:0
All time:1,409
This week:673Up
User Ratings User Comments (1)
 All time
Utility:92%StarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:85%StarStarStarStarStar
Examples:87%StarStarStarStarStar
Tests:-
Videos:-
Overall:72%StarStarStarStar
Rank:196
 
thankyou for this class
15 years ago (sandeep nami)
62%StarStarStarStar