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  
Name: Marco Marchiņ <contact>
Classes: 3 packages by
Country: Italy Italy
Age: 35
All time rank: 78429 in Italy Italy
Week rank: 131 Up3 in Italy Italy Up
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

  Files folder image Files (18)  /  tests  
File Role Description
  Accessible without login Plain text file grep.php Example Grep example
  Accessible without login Plain text file split.php Example Split example
  Accessible without login Plain text file replace_function_unicode.php Example Replace function unicode
  Accessible without login Plain text file replace_function.php Example Replace function example
  Accessible without login Plain text file replace_unicode.php Example Replace unicode
  Accessible without login Plain text file replace.php Example Replace example
  Accessible without login Plain text file email.php Example Email validation
  Accessible without login Plain text file phone.php Example Phone number validation
  Accessible without login Plain text file php_classes_header.php Example Php class header match
  Accessible without login Plain text file sql_datetime.php Example Sql datetime format validation
  Accessible without login Plain text file word_pairs.php Example Word pairs match
  Accessible without login Plain text file unicode.php Example Unicode characters example
  Accessible without login Plain text file condition.php Example Condition test
  Accessible without login Plain text file conditional_pattern.php Example Conditional pattern test
  Accessible without login Plain text file condition2.php Example Condition test 2
  Accessible without login Plain text file condition3.php Example Condition test 3

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:197
 
thankyou for this class
15 years ago (sandeep nami)
62%StarStarStarStar