首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

freemarker的replace效能

2012-12-23 
freemarker的replace功能替换字符串 replace${s?replace(‘ba’, ‘XY’ )}${s?replace(‘ba’, ‘XY’ , ‘规则参

freemarker的replace功能

替换字符串 replace${s?replace(‘ba’, ‘XY’ )}${s?replace(‘ba’, ‘XY’ , ‘规则参数’)}将s里的所有的ba替换成xy 规则参数包含: i r m s c f 具体含义如下:· i: 大小写不区分.· f: 只替换第一个出现被替换字符串的字符串· r:  XY是正则表达式· m: Multi-line mode for regular expressions. In multi-line mode the expressions ^ and $ match just after or just before, respectively, a line terminator or the end of the string. By default these expressions only match at the beginning and the end of the entire string.· s: Enables dotall mode for regular expressions (same as Perl singe-line mode). In dotall mode, the expression . matches any character, including a line terminator. By default this expression does not match line terminators.· c: Permits whitespace and comments in regular expressions.

热点排行