PHP Classes
elePHPant
Icontem

PHP Str Match and Split: Process strings with regular expressions

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2014-05-02 (1 year ago) RSS 2.0 feedNot yet rated by the usersTotal: 386 All time: 6,136 This week: 1,353Up
Version License PHP version Categories  
php-str-match-split 0.1GNU General Publi...3.0Text processing
Description Author  

This class can process strings with regular expressions.

It can process a given string to execute several types of operations with regular expressions.

Currently it can match a given regular expression and return the whole matched string or a given matched group, replace values that match a regular expression, and split a string with a given regular expression.

Picture of P Guardiario
Name: P Guardiario <contact>
Classes: 6 packages by
Country: Philippines Philippines
Age: ???
All time rank: 172118 in Philippines Philippines
Week rank: 904 Up9 in Philippines Philippines Up

Details provided by the author  
Phpstr
Give php strings easy to remember regex functionality
=========

Do you ever get tired of looking up preg functions because you forgot the order of the arguments? Me too.

```php
require 'phpstr.php';
```

Return a match
```php
str('There are 23 people reading this blog')->match('/\d+/');
```

Substitution
```php
str('all of the es')->gsub('/e/', 'y');
```

Scan will return an array of matches
```php
str('010 202 312 332')->scan('/\d+/');
```

Split will return an array of tokens
```php
str('010 202-312 332')->split('/\s/');
```
  Files folder image Files  
File Role Description
Plain text file phpstr.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file usage.php Example Example script

 Version Control Unique User Downloads Download Rankings  
 100%Total:386All time:6,136
 This week:0This week:1,353Up