title: How to add a string to a file with the execution of a regular expression?
body: <pre><code>import re
  import logging
  
  x = input("enter number of bad car")
  if re.match('/^[A-ZА-Я]{1}[0-9]{3}[A-ZА-Я]{2}([0-9]{0,3})?$/', x):
    logging.debug("found match" + x)
    with open("some.txt" , 'w') as f:
      f.write(x + '\n')
      else:
        logging.debug("does not match")
  </code></pre>
  
  <p>However, nothing is written in the file some.txt</p>