I have a Perl script that executes a regex to find a markup tag (<tag>
).
My regex is: <tag([^>]+)>
This works for most intances, however, I've found an instance where it's not working.
If <tag>
has the following formation....
<tag
attr="12345">
The regex works fine.
However, if <tag>
looks like this.
<tag attr="12345"
>
No match. I've tested my regex is Notepad++ and it works fine for all instances. The problem is in my Perl script.
I've attempted several end-of-line anchors, but no luck thus far. Any help is much appreciated!
Edited Here is my line of code.
$line =~s/<tag([^>]+)>/<!--tag $1-->/g;