```python
import re

def remove_whitespaces(text1):
  """
  Removes all whitespaces from the given string using regex.

  Args:
    text1: The input string.

  Returns:
    The string with all whitespaces removed.
  """
  return re.sub(r'\s+', '', text1)
```