title: How to match text in a cell to regex and keep only the text which matches regex?
body: <p>What I am trying to do: There is a large excel sheet with a lot haphazard customer information. I want to sort the email address and other data in a set format in a new excel file. </p>
  
  <p>I can't quite figure out how to match the cell text(which will have some format like Address Email squished togethe and similar) with the regex and to keep only the regex data in a list. </p>
  
  <p>Would really appreciate some help. Thanks</p>
  
  <pre><code>import sys, os, openpyxl
  def sort_email_from_xl():
      sheet = sheet_select()   #Opens the worksheet
      emailRegex = re.compile(r'''([a-zA-Z0-9._%+-]+@+[a-zA-Z0-9.-]+(\.[a-zA-Z]{2,4}))''',re.VERBOSE)
      customeremails = []
      for row in range(0, max_row):
          if cell.text == emailRegex:
              mail = cell.text
              customeremails.append(mail)
              return customeremails
      print(customeremails)
  </code></pre>