Join Slack
Powered by
How to replace 2 or more characters in advanced pd...
# advancedpdf
l
Luis
10/06/2024, 10:01 PM
How to replace 2 or more characters in advanced pdf? For example, I want to replace ; or ^ with blank space. I've tried ?replace(";"|"^"," ").
m
michoel
10/07/2024, 12:52 AM
You can either change the replaces
${field?replace(",", " ")?replace("^", " ")}
or use
regex
${field?replace(",|\\^", " ", "r")}
l
Luis
10/07/2024, 1:55 AM
Thank you. How do you know which characters to escape? (Sorry, not a developer)
Luis
10/07/2024, 1:55 AM
I am aware of the first option but I have like 10 characters to replace, so it'd be super long
m
michoel
10/07/2024, 3:35 AM
It would be any character that could be interpreted as a regex construct, can check the list
here
20
Views
Open in Slack
Previous
Next