return empty string if regex matches code example Example: regex to check non empty string /^(?!\s*$).+/