I'm using powerGrep to find instances of these:
BLOCK 1:
<td class="danish">kat
<?php audioButton("../../audio/words/dog","dog");?></td>
But there are also instances of these among my files:
BLOCK 2
<td class="danish">kat</td>
<td><?php audioButton("../../audio/words/dog","dog");?></td>
I want to find BLOCK 1 only, not BLOCK 2.
I've tried using (?!), as in
.*<td class(.*?)>(.*)(?!</td>)
.*<\?php audioButton\("(.*)/.*",".*"\);.*\?></td>
Can I somehow exclude the </td> tag from the search, so that BLOCK 2 is ignored?
I am not sure why you really want to match the first cell tag only, but to perform this you can try:
<td[^>]*>\s*(?:.(?!</td>))+\s*<\?php audioButton\("[^"]*/(.+?)","(.*?)"\);.*?\?>.*?</td>withgflag.see it working here: https://regex101.com/r/tI4rL4/1
[EDIT]
You can also see the replacement of
dogtocathere: https://regex101.com/r/tI4rL4/2It may not be perfect, since the question is a bit too vague, but it works. If you need to refine a bit or adjust or need a bit of explanation you can ask me!