Multi line regular expressions in Textmate

- Posted in development

I am mostly writing this for my own reference.

Because of the Sketch mask trick, when trying to export icons they had a mask in them that I did not want. Basically I had to remove all masks across 75 icons. Since SVGs are just text files, you can do some regex processing  to find all <mask> elements:

(?m)\<mask(.*)\/mask\>

The (?m) part is a filter that makes the regex work across multiple lines.

Sources

Leave a Reply

Your email address will not be published. Required fields are marked *