Hi y’all,
While processing HTML for my website, I found this peculiarity:
sometimes the HTML tag pattern is not captured as last used pattern and
cannot be reused in s//.../ idiom. Test file:
------------------------------------------------------------
<div class=note>
Note this
</div>
<div class=note>
And that!
</div>
------------------------------------------------------------
Test script:
------------------------------------------------------------
H
g/<div class=note.*/s//{/\
/<\/div.*/s//}/
,p
Q
------------------------------------------------------------
Expected result: text in curly braces. Actual result:
------------------------------------------------------------
$ ed -s test.txt < test.ed
{
Note this
}
<div class=note>
And that!
}
------------------------------------------------------------
Any ideas? Am I doing something wrong?
Best of luck,
--
Artyom Bologov
https://aartaka.me