Use regex in python to search for string which may have more space in between words of string or having a special character in between?

Viewed 21

I have to search for a string 1. Joyce Limited Company in a number of PDF files using Python. There this string can be present in any of the following formats. But how can I ensure string matching and identify the strings in the documents:

  1. "1. JoyceLimitedCompany"
  2. "1.JoyceLimitedCompany" Space can vary between words
  3. "1. Joyce Limited Company" Space can vary between words
  4. "1. joyce limited company" Case can vary
  5. "1 - joyce limited company" "instead of dot some other special character"

I am using Python for it but unable to figure out how to accomplish it. Any help will be appreciated.

0 Answers
Related