How do you run this regex in Freemarker ? The \. makes the template to crash.
<#assign clean = raw?replace('resource.([^\.]+)', 'resource.$1', 'r')/>
How do you run this regex in Freemarker ? The \. makes the template to crash.
<#assign clean = raw?replace('resource.([^\.]+)', 'resource.$1', 'r')/>
Use r'resource.([^\.]+)' or 'resource.([^\\.]+)'. Otherwise the problem is that FTL strings also use \ as an escape character (Just like C, Java, etc.), and there's no \. escape.