0

For example there is this line:

<a title="best title in the world" href="http://website.com/15661-erko-rhyno/">! Erko_Rhyno !</a>

Now my code returns:

15661-erko-rhyno/">! Erko_Rhyno !

Im using:

(?<=\<strong\>\<a title\=\"best title in the world\" href\=\"http:\/\/www\.website\.com\/web\/index\.php\/user\/).*?(?=\<\/a\>\<\/strong\>)

Now I need that it would be without 15661-erko-rhyno/"> like this:

! Erko_Rhyno !

I know why it returns with 15661-erko-rhyno/"> because I specified only ignore this part:

<strong><a title="best title in the world" href="http://www.webste.com/web/index.php/user/

But there is the problem now u see this part:

15661-erko-rhyno/">` 

Always changes and I don't know how to ignore this part, I will repeat myself and will provide again the code that I'm suing to ignore characters that I don't need::

(?<=\<strong\>\<a title\=\"best title in the world\" href\=\"http:\/\/www\.website\.com\/web\/index\.php\/user\/).*?(?=\<\/a\>\<\/strong\>)

Maybe someone could provide example or answer what I should put in order to ignore those lines whats left?

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
  • 1
    [Relevant](http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454). – Daedalus Jun 04 '14 at 02:54

1 Answers1

2

Just ignore the > character like

\>([^\>]+)\<\/a\>

to get ! Erko_Rhyno ! in group(1)

Fabricator
  • 12,722
  • 2
  • 27
  • 40