I have some text:
1. Lorem «ipsum» dolor sit amet, consectetur<br/>
2. adipisicing «elit», sed do eiusmod tempor<br/>
3. incididunt ut «labore» et dolore magna aliqua.<br/>
And I want to replace all "&laquo;
" to "&#171;
" and all "&raquo;
" to "&#187;
".
This replace only in first row:
txt.replace(new RegExp("&laquo;","gi"),"&#171;").replace(new RegExp("&raquo;", "gi"),"&#187;");
other rows still not changed.
What I am doing wrong?
Make your regex 'multiline':
new RegExp("&laquo;","gim")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With