0

Need to remove multiple instances of style="width:268px;height:34px;" in a file.

The # of pixels is different in every line.

The following regular expression finds the pattern when tested in http://regexstorm.net/tester

^style="width:[0-9]{1,3}px;height:[0-9]{1,3}px;"$

But Visual Studio 2017 does not find any results. What am I doing wrong?

Sample input:

<tr>
            <td nowrap="nowrap" style="width:268px;height:34px;"><a name="RANGE!A1">Advisors by Product</a></td>
            <td nowrap="nowrap" style="width:133px;height:34px;">&nbsp;</td>
            <td nowrap="nowrap" style="width:64px;height:34px;">&nbsp;</td>
            <td nowrap="nowrap" style="width:92px;height:34px;">&nbsp;</td>
        </tr>
        <tr>
            <td nowrap="nowrap" style="width:268px;height:21px;">&nbsp;</td>
            <td style="width:133px;height:21px;"><strong>Advisors</strong></td>
            <td nowrap="nowrap" style="width:64px;height:21px;"><strong>Office</strong></td>
            <td nowrap="nowrap" style="width:92px;height:21px;"><strong>Phone</strong></td>
        </tr>
        <tr>
            <td nowrap="nowrap" style="width:268px;height:21px;"><strong>Product A</strong></td>
            <td nowrap="nowrap" style="width:133px;height:21px;">&nbsp;</td>
            <td nowrap="nowrap" style="width:64px;height:21px;">&nbsp;</td>
            <td nowrap="nowrap" style="width:92px;height:21px;">&nbsp;</td>
        </tr>

regexstorm.net

joym8
  • 4,014
  • 3
  • 50
  • 93
  • 2
    By using `^` and `$` you are telling that the string have to match from the beginning until the end with the regular expression – dcg Sep 09 '19 at 19:06
  • That was it! 257 select/deletes saved! – joym8 Sep 09 '19 at 19:12

0 Answers0