Skip to content

Instantly share code, notes, and snippets.

@usualoma
Created March 31, 2011 05:03
Show Gist options
  • Save usualoma/895846 to your computer and use it in GitHub Desktop.
Save usualoma/895846 to your computer and use it in GitHub Desktop.
<mt:Var name="regex" value='/(.*?<img[^>]*src=")([^"]*)(.*)|.*/s' />
<mt:Unless regex_replace="$regex","$2">
<h1>test</h1>
<img src="http://www.example.com/test1.jpg" />
<p>message</p>
</mt:Unless>
<mt:Unless regex_replace="$regex","$2">
<h1>test</h1>
<img src="http://www.example.com/test1.jpg" />
<img src="http://www.example.com/test2.jpg" />
<p>message</p>
</mt:Unless>
<mt:Unless regex_replace="$regex","$2">
<h1>test</h1>
<p>message</p>
</mt:Unless>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment