Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##Collection of useful .replaceAll statements for dotCMS/velocity
- #### From http://dotcms.com/docs/1.9/VelocityStringReplaceRegex
- ## REMOVE HTML TAGS
- #set($mystring = "<span>test span</span><p> test p</p>")
- $mystring.replaceAll("</?[^>]+/?>", "");
- ## REMOVE P TAGS
- #set($mystring = "<span>test span</span><p> test p</p>")
- $mystring.replaceAll("</?p[^>]*/?>", "");
- #### Mine
- ## I THINK THIS IS BROKEN
- ## Replaces the @ and . in email addresses with their HTML special char equivalent to help prevent spam.
- ## Can be used in containers for to catch email addresses used in content
- #set($Body = $Body.replaceAll("\b([\w\.-]+)@([\w\.-]+)\.(\w{2,4})\b","$1@$2.$3"))
Advertisement
Add Comment
Please, Sign In to add comment