in reply to s!!! vs. s///

There's a subtle trap awaiting those who use s/// to modify HTML.
s/(^\d+[.]\s.+)/<h1>$1</h1>/g ; ^
Escape that character, or use something other than / to delimit the substitution.