RegEx works with freemarker, correct? I want to tr...
# advancedpdf
d
RegEx works with freemarker, correct? I want to trim a string up till the first number but haven't had any luck... any thoughts? Specifically on record.address?keep_after("[0-9]")
a
i haven't done this before but looking on the freemarker site it looks like you would need to add the "r" flag
${"foo : bar"?keep_after(r"\s*:\s*", "r")}
d
I tried ?keep_after(r'[0-9]') and it didn't keep anything in the string.
a
try
/d
maybe instead of
[0-9]
? just a guess but not sure if their implementation of regex recognizes the bracket notation
apparently this is the version of regex they've implemented: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html
d
hmmm strange, still same issue with ?keep_after(r'\d') but I'll check out that site, thanks
a
try
keep_after(r'\d', 'r')
d
Ah perfect, that worked! thanks!
a
great!