Wildcard search for text containing HTML code

I

ivanov.ivaylo

Hi all,

I have an html code pasted into Word. My task is to isolate only
specific parts of this code - that is, paste it into another Word file
and further process it.

The text I'm interested in placed between the following opening and
closing tags: <td valign=top>XXXXX</td> .

I need a wildcard Search string that can sellect all instances of
content between these tags. Then, I'll copy it and paste it manually.

Please pay attention that the text between the mentioned tags also
contains HTML code.

Can you please help me with the syntax of the search string?

Here is a sample text:


<td valign=top><b>àõðîìàòîïñèÿ</b><br>íåâúçìîæíîñò çà ðàçëè÷àâàíå íà
öâåòîâåòå, òîòàëíà öâåòíà ñëåïîòà.&nbsp;&nbsp;<br />&nbsp;&nbsp; íà
ëàòèíñêè åçèê: achromatopsia.<br />&nbsp;&nbsp; íà àíãëèéñêè åçèê:
achromatopsia, achromatopsy, colour blindness.</td>

Thank you in advance!
 
I

ivanov.ivaylo

The regex search string that does this is: <td valign=top>(.*?)</td>

Do you know who to conver this to MS Word search string?
 
T

Tony Jollans

Word has its own unique regex - the < and > characters mean start and end
word, respectively, and must be escaped (with prepended \) to be taken
literally. Try:

\<td valign=top\>*\</td\>

But note that it will fail if you have nested tables.
 
I

ivanov.ivaylo

Hi Tony,

Your string solved my problem. Thanks God that there were no nested
tables.

Thank you very much for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top