This is a word boundary Regular Expression which support non latin letters , it works in Chrome but not in Safari. any alternative solution?
new RegExp("(?<=[\\s,.:;\"']|^)" + word + "(?=[\\s,.:;\"']|$)","g");
Thanks
This is a word boundary Regular Expression which support non latin letters , it works in Chrome but not in Safari. any alternative solution?
new RegExp("(?<=[\\s,.:;\"']|^)" + word + "(?=[\\s,.:;\"']|$)","g");
Thanks
Look behind assertions are not supported in Safari. Check compatibility table here
Instead you can try without it.
Example