This message was deleted.
# suitescript
s
This message was deleted.
p
replace only replaces the first instance as standard, you need to throw in the /g to get it to replace all occurrences.
Copy code
.replace(/&/g, "and");
c
Thanks! 🙂 But it does not work, but now i know what the error is caused by
z
Building on the previous response, you need the
m
flag too, which means "multiline" since your memo text has newlines in it (
\n
is the newline character I noticed). So,
g
for global and
m
for multiline:
Copy code
.replace(/&/gm, 'and')
For more info on regex, I highly recommend these sites: https://regex101.com/ https://regexr.com/ https://www.regular-expressions.info/
c
Yes i figured it out, but thanks anyways 😄
🙂 1