Search code examples
regexsearchreplacegreptextwrangler

How search and replace with Textwrangler xml tag ? with grep?


For example, i try to search and delete in an XML file all node wp:postmeta who has different content

    <wp:postmeta>
        <wp:meta_key>_edit_last</wp:meta_key>
        <wp:meta_value><![CDATA[2]]></wp:meta_value>
    </wp:postmeta>

I'll try first something like : <wp:postmeta>*</wp:postmeta> thinking that it will return all the node. But it doesn't work. What is the methodology for that sort of search ? Thx


Solution

  • <wp:postmeta>[\s\S]*?</wp:postmeta>
    

    Try this.See demo.

    http://regex101.com/r/sA8iT4/2