1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Regex]is this queston too difficult for you too?

Discussion in 'General Programming Chat' started by jameswkh, Apr 30, 2016.

  1. jameswkh

    jameswkh Newbie

    Joined:
    Nov 11, 2015
    Messages:
    18
    Likes Received:
    0
    Hi all,

    I amm writing something using REGEX.


    i need to match all <a href.....>XXXXXXXXXXXXX</a> where XXXXXXXXXXXXX do not contain </a> ,

    that means to stop matching when the first </a> appears.

    I tried a lot but till cannot make it, can anyone think of a solution?

    Thank you guys!
     
  2. kevinlewontin

    kevinlewontin Registered Member

    Joined:
    Apr 25, 2016
    Messages:
    64
    Likes Received:
    32
    Code:
    [FONT=Consolas]/<a[^>]*>([^<]+)</a>/g[/FONT]
    Disclaimer: I found this by googling "Regex for anchor tags" and clicking the first StackOverflow link.

    You can get answers for most of the programming questions by doing this.
     
    Last edited: Apr 30, 2016
  3. jameswkh

    jameswkh Newbie

    Joined:
    Nov 11, 2015
    Messages:
    18
    Likes Received:
    0
    thank you bro, i am looking into it