The Right Tool for this job does not need to be html or css aware, since the original request was to allow passing regexes on the cli.
I am all for any solution that does the job with the minimum fuss (unlike this discussion

) but I see no reason to invent a new tool with unnecessary components.
Thus, for regex, use a pre-existing regex solution. I'm not fussy, it doesn't have to be sed.