Reputation: 6418
How do you run this regex in Freemarker ? The \.
makes the template to crash.
<#assign clean = raw?replace('resource.([^\.]+)', 'resource.$1', 'r')/>
Upvotes: 2
Views: 1959
Reputation: 31122
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.
Upvotes: 2