#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2009
    Posts
    1
    Rep Power
    0

    Arrow How ot formulate a REGEX for this?


    Hi
    Let say i have an html codes below,

    Code:
     <html>
     <head>
     </head>
    
     <body>
     <h4>this is H4 heading one</h4>
         <a href="domain.com">one</a>
         <a href="domain.com">two</a>
         <a href="domain.com">three</a>
     <h4>this is H4 heading two</h4>
     </body>
     </html>
    What i want is to get all the link between H4 heading one and H4 heading two.

    Can you show me the right REGEX syntax for this please.

    Thank you in advance.
  2. #2
  3. No Profile Picture
    User 165270
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2005
    Posts
    497
    Rep Power
    937
    This regex works for your example-input:

    Code:
    (?<==")[^"]+(?=")

IMN logo majestic logo threadwatch logo seochat tools logo