regular expression ignore if string has spaces code example Example: regex ignore spaces \s* ignore spaces eg \s*yourregex\s*