old_contents: import re
  from typing import Any, List, Text
  
  from rasa.nlu.components import Component
  from rasa.nlu.config import RasaNLUModelConfig
  from rasa.nlu.tokenizers import Token, Tokenizer
  from rasa.nlu.training_data import Message, TrainingData
  
  
  class WhitespaceTokenizer(Tokenizer, Component):
  
      provides = ["tokens"]
  
      def train(self, training_data: TrainingData, config: RasaNLUModelConfig,
                **kwargs: Any) -> None:
  
          for example in training_data.training_examples:
              example.set("tokens", self.tokenize(example.text))
  
      def process(self, message: Message, **kwargs: Any) -> None:
  
          message.set("tokens", self.tokenize(message.text))
  
      @staticmethod
      def tokenize(text: Text) -> List[Token]:
  
          # remove 'not a word character' if
          words = re.sub(
              # there is a space or an end of a string after it
              r'[^\w#@&]+(\s|$)|'
              # there is a space or beginning of a string before it
              # not followed by a number
              r'(\s|^)[^\w#@&]+(?=[^0-9])|'
              # not in between numbers and not . or @ or & or - or #
              # e.g. 10'000.00 or blabla@gmail.com
              # and not url characters
              r'(?<=[^0-9])[^\w._~:/?#\[\]@!$&*+,;=-]+(?=[^0-9])',
              ' ', text
          ).split()
  
          running_offset = 0
          tokens = []
          for word in words:
              word_offset = text.index(word, running_offset)
              word_len = len(word)
              running_offset = word_offset + word_len
              tokens.append(Token(word, word_offset))
          return tokens
  
new_contents: import re
  from typing import Any, List, Text
  
  from rasa.nlu.components import Component
  from rasa.nlu.config import RasaNLUModelConfig
  from rasa.nlu.tokenizers import Token, Tokenizer
  from rasa.nlu.training_data import Message, TrainingData
  
  
  class WhitespaceTokenizer(Tokenizer, Component):
  
      provides = ["tokens"]
  
      def train(self, training_data: TrainingData, config: RasaNLUModelConfig,
                **kwargs: Any) -> None:
  
          for example in training_data.training_examples:
              example.set("tokens", self.tokenize(example.text))
  
      def process(self, message: Message, **kwargs: Any) -> None:
  
          message.set("tokens", self.tokenize(message.text))
  
      @staticmethod
      def tokenize(text: Text) -> List[Token]:
          # remove 'not a word character' if
          words = re.sub(
              # there is a space or an end of a string after it
              r'[^\w#@&]+(?=\s|$)|'
              # there is a space or beginning of a string before it
              # not followed by a number
              r'(\s|^)[^\w#@&]+(?=[^0-9\s])|'
              # not in between numbers and not . or @ or & or - or #
              # e.g. 10'000.00 or blabla@gmail.com
              # and not url characters
              r'(?<=[^0-9\s])[^\w._~:/?#\[\]()@!$&*+,;=-]+(?=[^0-9\s])',
              ' ', text
          ).split()
  
          running_offset = 0
          tokens = []
          for word in words:
              word_offset = text.index(word, running_offset)
              word_len = len(word)
              running_offset = word_offset + word_len
              tokens.append(Token(word, word_offset))
          return tokens
  
subject: fix regex