C
C
crimson52013-12-15 16:53:12
Parsing
crimson5, 2013-12-15 16:53:12

Is there a regular expression that would pull out site.ru only in the place where there is an inscription No IP, but skipped where the ip is?

Hello.
The problem is this, I’m making a small parser, everything is ready, it remains only to compose the correct regular expression, please help.
There is a site on the page of which there are such results

<td><a href='/simplesearch?domainsimple=site.ru&fromadvs=1'>site.ru</a></td>
    
<td><font color='green'>Свободен</font><div style="margin: 3px 0 3px 0;"><a style='font-size: x-small; color: green;' target='_blank' href='https://www.nic.ru/manager/registration.cgi?ipartner=3140&step=new_srv.select_pack&new_domain=site.ru&Next=1&rst=all' title='site.ru свободен и вы можете его зарегистрировать.'>Занять <img border='0' src='/img/green.gif'></a></div></td>
<td>
  <font style='color: #f5989d;'>Нет IP</font>
</td>

We need such a regular program that would pull out site.ru , but pull it out only in the place where there is an inscription No IP , and skipped where the ip is.
All that was found was
(?<=<a\ href="/simplesearch\?domainsimple=).*(?=&amp;)

But such a regular expression parses all the results, but only those where the inscription, No IP is necessary.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pomeo, 2013-12-15
@pomeo

xpath see why you need a regular expression for html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question