String Replace / Regex - Documentation topics on: regex,velocity string replace,.

String Replace / Regex

Here are some examples:

if you need to remove all html tags:

#set($mystring = "<span>test span</span><p> test p</p>")
$mystring.replaceAll("</?[^>]+/?>", "");

to remove, for example, only p tags

#set($mystring = "<span>test span</span><p> test p</p>")
$mystring.replaceAll("</?p[^>]*/?>", "");