Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2009
    Posts
    351
    Thanks
    75
    Thanked 0 Times in 0 Posts

    Regular Expression to match this

    Hi guys.

    Im looking for a regular expression to match html in this format

    PHP Code:
    <class="fn repname_busName repkey_IE_600885_5" href="/Florists/Aisling_Flowers_Cork/IE_600885_5">Aisling Flowers Cork</a>

    $strListMatches '!<a class="fn repname_busName repkey_IE_[0-9]*_[0-9]*" href="(.*)">(.*)</a>!isU'
    but it doesnt seem to work.

    Can anyone help me out?
    Last edited by kevinkhan; 11-02-2009 at 11:15 AM.

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by kevinkhan View Post
    Hi guys.

    Im looking for a regular expression to match html in this format

    PHP Code:
    <class="fn repname_busName repkey_IE_600885_5" href="/Florists/Aisling_Flowers_Cork/IE_600885_5">Aisling Flowers Cork</a>

    $strListMatches '!<a class="fn repname_busName repkey_IE_[0-9]*_[0-9]*" href="(.*)">(.*)</a>!isU'
    but it doesnt seem to work.

    Can anyone help me out?
    Probably I will never understand why people generate code in a place and then try to write complicate regex to parse it in another place on the same site.
    Anyway you didn't say what do you want to match, or you said and I miss it?

    best regards

  • #3
    Regular Coder
    Join Date
    Jun 2009
    Posts
    351
    Thanks
    75
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by oesxyl View Post
    Probably I will never understand why people generate code in a place and then try to write complicate regex to parse it in another place on the same site.
    Anyway you didn't say what do you want to match, or you said and I miss it?

    best regards
    I want to extract the title and link...


  •  

    Posting Permissions

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