javascript - Modifying an existing RegEx to accommodate also replacing <nbsp;>'s with a blank space -


i need help,

how can existing code below modified such not takes account replacing <br>'s \n's <nbsp;>'s anywhere in string space separator in javascript?

here existing code needs modified:

var txt = str.replace(/<br\s*\/?>/mg,"\n") 

you may use this

var txt = str.replace(/<br ?/?>/g, '\n').replace(/&nbsp;/g, ' '); 

but can't 2 replacements using 1 regex


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -