3 ms·
I wish I could reply to the dead response, but I’ll address it here: > sed -Ei 's/foo|bar/foobar/g' ? Regex manipulation of arbitrarily structured data like H
by eyelidlessness 6y ago
I wish I could reply to the dead response, but I’ll address it here:
> sed -Ei 's/foo|bar/foobar/g' ?
Regex manipulation of arbitrarily structured data like HTML (and CSS!) is such a bad idea it became a meme[1]. Even where you fully control the data, there are so many potential footguns it’s not worth considering.
Surely there are tools more fit for the job, but at the point you’re using tooling like that you’ve just replaced “stack” with “random commands that are implicitly part of my workflow”.
[1]: https://stackoverflow.com/a/1732454 https://stackoverflow.com/a/1732454
- johnchristopher 6y agoOh, I know what to do ! Let's add an XSL that would just applies those changes without modifying the original HTML ! We can even version those XSL to reflect change history ! eg. update.01.xsl, update.02.xsl, etc.