Results 1 to 2 of 2

Thread: PCRE Help

  1. #1
    Join Date
    May 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PCRE Help

    I am new to PCRE in PHP and understand the basic patterns however the ones below are a bit complex and I don't understand what the following pattern matches:

    PHP Code:
    $ret preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#... "<a href='' rel='nofollow'></a>", $ret);

    $ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*... "<a href='http://' rel='nofollow'></a>", $ret); 
    Could someone please explain and link me to some good tuts. Thanks.

  2. #2
    Join Date
    May 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    No replies, is anyone good at PCRE here?

    It doesn't matter anyway now I worked out the first one matches a url with :// in it and the second one matches a url with www. or ftp.

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
  •