title: Substitute white spaces inside a Spanish date in a string with regex
body: <p>When processing strings, I have found addresses with text inside in Spanish like '28 de julio'. I want a regex to detect that combination of 'day' 'de' 'month' and then suppress the white spaces in between. The months in Spanish can start with 'ene', 'feb', 'mar', 'abr', 'may', 'jun', 'jul', 'ago', 'set', 'sep', 'oct', 'nov' or 'dic'.</p>
  <p>So if I have this address:
  'avenida 10 de octubre 2546, managua'
  I want to convert it to:
  'avenida 10deoctubre 2546, managua'</p>
  <p>This is what I have tried:</p>
  <pre><code>import re
  my_address = 'calle 4 de julio, heredia'
  
  def compress_date_street_name(address: str) -&gt;str:
      if address is not None:
          result = re.sub(r'(\d{1,2}\sde\[ene*|feb*|mar*|abr*|may*|jun*|jul*|ago*|set*|sep*|oct*|nov*|dic*])','\d{1,2}de', address)
      else:
          result = None
      return result
  </code></pre>
  <p>For this string the expected result is: 'calle 4dejulio, heredia'.</p>
  <p>But it returns me an error that there is a bad scape. I'm not sure if my regex will do the detection I need. Any help will be greatly appreciated.</p>