regex remove empty lines and spaces code example
Example 1: regular expression to remove empty lines after text
Find: ^(?:[\t ]*(?:\r?\n|\r))+
Replace: ""
Example 2: regex to remove spaces
//..
return str.replace(/\s/g, '');
//..
Find: ^(?:[\t ]*(?:\r?\n|\r))+
Replace: ""
//..
return str.replace(/\s/g, '');
//..