SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict Divisive Cotton's Avatar
    Join Date
    Jun 2008
    Location
    Andy lives in London, UK
    Posts
    393
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Tips / sources for learning regular expressions in PHP and for mod-rewrite

    I presume that regex for PHP and mod-rewrite / Apache are identical

    Do you have any recommendations for online tutorials or books or software to help in the learning of regular expressions?
    Let everyday be Christmas

  2. #2
    SitePoint Member
    Join Date
    Jun 2009
    Location
    Winter Park, FL
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is an old thread at another forum, but i learned tons from it!

    it gets into using datafeeds, mod rewrite, and regex expressions for both dynamic page naming as well as editing content so that it's unique. it's a long thread, but if you step through it, you'll make a bunch of progress.

    forum.abestweb.com/showthread.php?t=60200

    the best book i've ever seen for this, comes from sitepoint:
    http://www.sitepoint.com/books/phpmysql1/
    i keep a copy at my desk, it's well worth the money!

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2008
    Posts
    126
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems like implementations of regex in two different places are never identical, so I wouldn't assume that, but at least they're often similar. The knowledge of one can translate pretty well to the other, but it's always worth double-checking your constructions against the manual for wherever your using it (Apache mod_rewrite, PHP, etc.), and testing.

  4. #4
    messing with my mind fristi's Avatar
    Join Date
    Feb 2009
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use this site alot:
    http://www.regular-expressions.info/
    To PHP or to Perl, that is the question!
    (Bucket - simpletest) User

  5. #5
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    I have a PHP pcre cheat sheet on my wall, I understand when to use almost every line of it now (I wouldn't say I know the most efficient way of using each line, just that the terms are familiar).

    PHPGurus' PHP PCRE Cheat Sheet

    I use regex's quite infrequently so feel like some kind of goldfish, constantly re-learning the same basics over and again.

    In recognition of that I found this little tutorial gets me back into the groove within a few minutes:

    http://gnosis.cx/publish/programming...pressions.html

    That, and installing a copy of "Regex Coach" a small desktop test programme does me most of the time.

    Anything stronger, and I go to the site fristi just recommended.

    Those regex's you mention do not have exactly the same implementation.

    Any time you make a regex and, *gasp* shock, it actually works, post it on this board and some regex God will likely swoop down on and improve it for you.

    Leaving yourself open to public scrutiny (and possible humiliation) tends to drive some people to self-improvement - but does provide amusement for the many.
    Edit:

    How can I forget SP's own Joy of Regex.


    (Where is HarryF these days anyway?)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •