1

Textfile contains blocks:

<tr>
    <td>waitForElementPresent</td>
    <td>//div</td>
    <td></td>
</tr>
<tr>
    <td>assertElementPresent</td>
    <td>//div</td>
    <td></td>
</tr>

I want to remove all blocks with regexp in notepad++ with the word assertElementPresent in it:

<tr>*assertElementPresent*</tr>

who can help me with the regular expression??

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
Daan
  • 11
  • 2

2 Answers2

1
<tr>.*?assertElementPresent.*?</tr>

should be a good start (note the ungreedy matches), however, it's rather brittle.

Piskvor left the building
  • 91,498
  • 46
  • 177
  • 222
1
<tr>(?!.*<tr>.*).*?assertElementPresent.*?</tr>

It has been tested with RAD and RegExr. The previous suggested solution picks the previous row also..

Gursel Koca
  • 20,940
  • 2
  • 24
  • 34