Answer by vks for Match of carriage return, line feed and multiple space in...
\s match any white space character [\r\n\t\f ] You should use \s{2,} for this.It is made for this task.
View ArticleAnswer by sp00m for Match of carriage return, line feed and multiple space in...
This simple one should suit your needs: /[\r\n ]{2,}/g. Replace by a space.
View ArticleAnswer by streetturtle for Match of carriage return, line feed and multiple...
This will work: /\n|\s{2,}/g var res = str.replace(/\n|\s{2,}/g, " "); You can test it here: https://regex101.com/r/pQ8zU1/1
View ArticleMatch of carriage return, line feed and multiple space in javascript regular...
I am trying replace carriage return (\r) and newline (\n) and more than one spaces (' ' ) with single space. I used \W+ which helped to achieve this but, it's replacing special characters also with...
View Article
More Pages to Explore .....