Miscellaneous

  Home arrow Miscellaneous arrow Using PCREs
MISCELLANEOUS

Using PCREs
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2002-11-16

    Table of Contents:
  • Using PCREs
  • Section 1
  • Section 2
  • Section 3
  • Wrapping Things Up

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    Using PCREs


    (Page 1 of 5 )

    In this tutorial, Sam shows you how to use Regular Expressions.

    By : Sam Fullman

    There are a bunch of good elementary tutorials out there on Regular Expressions. Just do a search at google.com.

    However, what I am about to share encapsulates many of the frustrations I encountered in developing expressions that would work every time, and that always captured any variant in the string I was searching.

    So if you're banging your head against the monitor even after you have read other articles, this is the one to read. You can think of this as the advanced class. If you're looking to get file strings off the web and do editing or analysis, you need to know this stuff. You may not always need to be this complex when you develop regex'es, but if you'll study the concepts, you can be assured you've learned something, and have the confidence you'll find what you're looking for (if it's there).

    Before you begin this tutorial, you need to go to the following page I've created for testing Regular Expressions (you'll probably want to bookmark this page).http://samuelfullman.com/team/php/tools/regular_expression_tester_p.php

    Next, you'll want to know the actual php code you can use for any of the outlined regular expressions (regexes) through this tutorial:

    <?php
    $subject 
    "some string strung strong of text";
    $findMatches preg_match_all('/str.ng/',$subject,$matches);
    if(
    $findMatches){
    for(
    $i=0;$i&lt;count($matches[0]);$i++){
    echo 
    $matches[0][$i] . "&lt;BR&gt;";
    }
    }
    ?>

    More Miscellaneous Articles
    More By Codewalkers

    blog comments powered by Disqus

    MISCELLANEOUS ARTICLES

    - Oracle Database XE: Indexes and Sequences
    - Modifying Tables in Oracle Database XE
    - Oracle Database XE: Tables and Constraints
    - More on Oracle Databases and Datatypes
    - Oracle Database XE Datatypes: Datetime and L...
    - Oracle Database XE Datatypes: Character and ...
    - From Databases to Datatypes
    - Firefox 3.6.6 Released with Improved Plug-in...
    - Attention Bloggers: WordPress 3.0 Now Releas...
    - Reflection in PHP 5
    - Inheritance and Other Advanced OOP Features
    - Advanced OOP Features
    - Linux from Scratch V.6.6 Review
    - Linux Gaining in Strength
    - Install Slackware on Your Old PC


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 5 - Follow our Sitemap