T
taylorjonl
I am having a problem matching some text. It is a very simple pattern
but it doesn't seem to work. Here goes.
<td[^>]*>.*?</td>
That is the pattern, it should match any <td></td> pair. Here is my
input data.
<td valign="top">Buyer<a href="http://www.google.com">google</a><img
src="www.google.com/s.gif" width="4" border="0">(<a
href="www.google.com">9</a> )<span> </span></td>
<td valign="top">
Buyer
<a href="http://www.google.com">google</a><img
src="www.google.com/s.gif" width="4" border="0">
(
<a href="www.google.com">9</a> )<span> </span></td>
The first and second are exactly the same but the first has the spaces
removed. The pattern will match the first but not match the second. I
am very confused.
I have ran some tests. This pattern will match the first but not the
second.
<td[^>]*>.*?Buyer
This will match both of them.
<td[^>]*>\s*?Buyer
This indicates to me that the '.' is not matching a space character.
Any ideas?
but it doesn't seem to work. Here goes.
<td[^>]*>.*?</td>
That is the pattern, it should match any <td></td> pair. Here is my
input data.
<td valign="top">Buyer<a href="http://www.google.com">google</a><img
src="www.google.com/s.gif" width="4" border="0">(<a
href="www.google.com">9</a> )<span> </span></td>
<td valign="top">
Buyer
<a href="http://www.google.com">google</a><img
src="www.google.com/s.gif" width="4" border="0">
(
<a href="www.google.com">9</a> )<span> </span></td>
The first and second are exactly the same but the first has the spaces
removed. The pattern will match the first but not match the second. I
am very confused.
I have ran some tests. This pattern will match the first but not the
second.
<td[^>]*>.*?Buyer
This will match both of them.
<td[^>]*>\s*?Buyer
This indicates to me that the '.' is not matching a space character.
Any ideas?