title: 'str' object cannot be interpreted as an integer in regex
body: <pre><code>import re
  
  def regex(tex):
    text = re.compile('[А-ЯӨҮа-яөү0-9/s]')
    tex = text.sub(&quot;\n+&quot;, '\n', tex)
    tex = text.sub('\s+', ' ', tex) 
    tex = text.sub(&quot;\s+($)&quot;, '', tex)
    stopword = ['ч','л','аа', 'ээ', 'оо', 'өө', 'даа', 'дээ', 'дөө', 'доо']
    text = ' '.join([word for word in text.split() if word not in stopword])
    return text 
  
  text = &quot;Намайг Анужин \n\n\n гэдэг  дээ shushus &quot; 
  print(text)
  print(regex(text))
  </code></pre>
  <p><a href="https://i.stack.imgur.com/OYZBH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OYZBH.png" alt="enter image description here" /></a></p>
  <p>Please tell me what the error is and how to fix it.</p>