regex match only without spaces code example
Example 1: regex to remove spaces
//..
return str.replace(/\s/g, '');
//..
Example 2: regex ignore spaces
\s* ignore spaces
eg \s*yourregex\s*
//..
return str.replace(/\s/g, '');
//..
\s* ignore spaces
eg \s*yourregex\s*