Joseph Rosevear
2024-09-28 05:28:38 UTC
Hello,
This may be off topic, but let me try anyway.
I've been editing HTML. I used to write my comments (incorrectly) like
this:
<! comment.>
I asked my AI friend, Pi, for help and he said do this in vim:
:%s/<!\s*(.*)>/<!-- \1-->/g
I've used vi, so I tried that and vim. I don't know if it matters.
Anyway, I got "No match found."
I could do other sorts of search and replaces, but not using the (.*) and
\1 combination.
This was frustrating, because Pi kept telling me it should work. But it
didn't. I'm wondering if I'm missing something?
Of course my goal is to simplify the editing of the above bad comment,
changing it to:
<!-- comment.-->
Help me if you can?
-Joe
This may be off topic, but let me try anyway.
I've been editing HTML. I used to write my comments (incorrectly) like
this:
<! comment.>
I asked my AI friend, Pi, for help and he said do this in vim:
:%s/<!\s*(.*)>/<!-- \1-->/g
I've used vi, so I tried that and vim. I don't know if it matters.
Anyway, I got "No match found."
I could do other sorts of search and replaces, but not using the (.*) and
\1 combination.
This was frustrating, because Pi kept telling me it should work. But it
didn't. I'm wondering if I'm missing something?
Of course my goal is to simplify the editing of the above bad comment,
changing it to:
<!-- comment.-->
Help me if you can?
-Joe