Need to replace
Are you? [xxxrecipientFirstNamexxx]
withAre you? {recipientFirstName}
. I tried using Boundary Matchers .But result is not as expected . I tried with below code"<p>Are you? [xxxrecipientFirstNamexxx] </p>".replaceAll("\\b[[xxxrecipientFirstNamexxx]]\\b", "{recipientFirstName}");
.Can any one help on this?
Use REGEX to find and replace:
Find: \[xxx(.*)xxx\]
Replace it with {$1}
In python:
import re
line = re.sub(
r"\[xxx(.*)xxx\]",
"{$1}",
line
)