title: Combining Many Regex Operations Together
body: <p>I am working on an NLP project of text processing using python in which I need to do a data cleaning before feature extractions. 
  I am doing the cleaning of special characters and number separations with chars using regex operation but I am doing all these in many operations separately which is making it slow. I want to make it in as few as possible operations or in a faster way.</p>
  
  <p>my code is as follows</p>
  
  <pre><code>def remove_special_char(x):
      if type(x) is str:
          x = x.replace('-', ' ').replace('(', ',').replace(')', ',')
          x = re.compile(r"\s+").sub(" ", x).strip()
          x = re.sub(r'[^A-Z a-z 0-9-,.x]+', '', x).lower()
          x = re.sub(r"([0-9]+(\.[0-9]+)?)",r" \1 ", x).strip()
          x = x.replace(",,",",")
          return x
      else:
          return x 
  </code></pre>
  
  <p>Can anyone help me?</p>