I try to wrap string with # hashtag character follow any language , below is my code after I add u shows error Invalid flag supplied to RegExp constructor., how to solve it?
javascript
text.replace(/#([a-z0-9_\pL_]+)/igu, '<a href="'+url+'/$1">@$1</a>');
uis not a valid modifier?u? JavaScript is Unicode-aware already.uonly select english characteruthen it doesn't work at all, or select any character; because - as noted - it's both unnecessary and an invalid modifier.