any idea how to set this regex on freemarker `rep...
# advancedpdf
i
any idea how to set this regex on freemarker
replace
? This is an example of the string
3 foot x $0
I want to replace everything after
x
so it should be just
3 foot
, I triied this
?replace(r"\sx\s.*", "")
s
Try adding a third parameter to the replace function,
"r"
. That is needed for it to evaluate the first parameter as a regular expression. Otherwise, it is treated as text.
?replace("\sx\s.*", "", "r")
m
you might wanna try
?keep_before(" x")