title: using regex to identify characters and digits in python
body: <p>I have phone numbers that might look like:</p>
  
  <pre><code>927-6847
  611-6701p3715ou264-5435
  869-6289fillemichelinemoisan
  613-5000p4238soirou570-9639cel
  </code></pre>
  
  <p>and so on...</p>
  
  <p>I want to identify and break them into:</p>
  
  <pre><code>9276847
  6116701
  2645435
  8696289
  6135000
  5709639
  </code></pre>
  
  <p>String to store somewhere else:</p>
  
  <pre><code>611-6701p3715ou264-5435
  869-6289fillemichelinemoisan
  613-5000p4238soirou570-9639cel
  </code></pre>
  
  <p>When there is a <code>p</code> between digits, The number after p is an extension- get the number before p and save the whole string somewhere else
  When there is <code>ou</code>, another number starts after that
  When there is <code>cel</code> or any random string, get the number part and save the whole string somewhere else</p>
  
  <p>Edit: This is what I have tried:</p>
  
  <pre><code>phNumber='928-4612cel'
  if not re.match('^[\d]*$', phNumber):
       res = re.match("(.*?)[a-z]",re.sub('[^\d\w]', '', phNumber)).group(1)    
  </code></pre>
  
  <p>I am looking to handle cases and identify which of the strings had more characters before they were chopped off through regex</p>