Having trouble with very simple thing,
How to properly replace all < br>
and
in the string with the empty space?
This is
you can achieve that using this:
str = str.replace(/
/gi,' ');
This will match:
matches the characters
literally (case insensitive)
\s*
match any white space character [\r\n\t\f ]
*
Between zero and unlimited times, as many times as possible, giving back as needed [greedy]\/?
matches the character /
literally
?
Between zero and one time, as many times as possible, giving back as needed [greedy]>
matches the characters >
literallyg
modifier: global. All matches (don't return on first match)i
modifier: insensitive. Case insensitive match (ignores case of [a-zA-Z]
)var str = "This
phrase
output
will
have
0 br";
str = str.replace(/
/gi, ' ');
console.log(str)