05-23-2022 07:05 AM
Hi, I am trying to replace the words that starts with ‘Auft’ because somehow it changes the next two characters by ��
Image Below:
I’m not a professional in regex expressions so I am trying to learn it but I can’t come up with the solution. I always taught you could do $title.replaceAll(‘Auft’.*, ‘Auftragge’)
05-23-2022 07:10 AM
replaceAll() is expecting a string literal, so it is looking for a period and asterisk to follow Auft.
I think what you want is the replace() method using an expression. This would be something like the following:
$title.replace(/Auft.*/g, 'Auftragge')