https://netsuiteprofessionals.com logo
Title
i

irurzo

12/02/2020, 7:44 PM
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

scottvonduhn

12/02/2020, 10:21 PM
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

Mars

12/03/2020, 2:51 AM
you might wanna try
?keep_before(" x")