Login   Register  
PHP Classes
elePHPant
Icontem

preg_magic: Extract data from text using 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 (17)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2008-08-19 (6 years ago) RSS 2.0 feedStarStarStarStar 74%Total: 1,370 All time: 2,643 This week: 1,442Up
Version License PHP version Categories  
preg_magic 1GNU General Public Lice...5PHP 5, Text processing
Description Author  

This class can be used to extract data from text using regular expression patterns.

It takes an array of regular expressions that define the patterns to match and extract data.

An entry of the expressions array may be another array that defines patterns of repetitive sections that must be iterated to extract data from each of the repeated sections, like for instance HTML tables with sections of the rows of cell data.

The extracted data patterns is returned in associative arrays.

Innovation Award  
PHP Programming Innovation award nominee
February 2008
Number 7


Prize: One downloadable copy of Komodo Pro
Regular expressions are often used to extract information from different types of text documents.

Sometimes it is necessary to extract information that appears with the same format in multiple sections of a document, like for instance, text that is presented in multiple rows of HTML table. Extracting data from this kind document may require the use of multiple types of regular expressions.

This class provides a solution to simplify the extraction of text from document with repetitive sections by iterating through a set of given regular expressions.

Manuel Lemos
Picture of Shannon Wynter
Name: Shannon Wynter is available for providing paid consulting. Contact Shannon Wynter .
Classes: 9 packages by
Country: Australia Australia
Age: 33
All time rank: 1232 in Australia Australia
Week rank: 499 Down5 in Australia Australia Down
Innovation award
Innovation award
Nominee: 3x

  Files folder image Files  
File Role Description
Files folder imagedoc (7 files, 2 directories)
Files folder imageexample (3 files)
Accessible without login Plain text file document.sh Data Documentation Generator
Plain text file preg_magic.php Class Main class/function file
Accessible without login Plain text file README Doc. Readme file

  Files folder image Files  /  doc  
File Role Description
Files folder imagemedia (2 files)
Files folder imagepreg_magic (2 files)
  Accessible without login HTML file blank.html Doc. Documentation
  Accessible without login HTML file classtrees_preg_magic.html Doc. Documentation
  Accessible without login HTML file elementindex.html Doc. Documentation
  Accessible without login HTML file elementindex_preg_magic.html Doc. Documentation
  Accessible without login HTML file index.html Doc. Main Documentation Index
  Accessible without login HTML file li_preg_magic.html Doc. Documentation
  Accessible without login HTML file packages.html Doc. Documentation

  Files folder image Files  /  doc  /  media  
File Role Description
  Accessible without login Plain text file banner.css Data CSS for Documentation
  Accessible without login Plain text file stylesheet.css Data CSS for Documentation

  Files folder image Files  /  doc  /  preg_magic  
File Role Description
  Accessible without login HTML file preg_magic.html Doc. Documentation
  Accessible without login HTML file _preg_magic.php.html Doc. Documentation

  Files folder image Files  /  example  
File Role Description
  Accessible without login Plain text file fields_example.php Example An example fields layout
  Accessible without login Plain text file full_example.php Example A complete example
  Accessible without login Plain text file history.html Data Example data

 Version Control Unique User Downloads Download Rankings  
 0%Total:1,370All time:2,643
 This week:0This week:1,442Up
User Ratings User Comments (1)  
 All time
Utility:91%StarStarStarStarStar
Consistency:91%StarStarStarStarStar
Documentation:91%StarStarStarStarStar
Examples:100%StarStarStarStarStarStar
Tests:-
Videos:-
Overall:74%StarStarStarStar
Rank:92
 
thank you for you word.
6 years ago (webcgo)
80%StarStarStarStarStar