fork download
  1. import re
  2.  
  3. txt = 'Port of Discharge/ Airport of destination\tXYZABC\t\t\t\t\t\t\t\t44B'
  4. pat = r' port.{0,6}discharge.{0,3}/.{0,3}airport.{0,7}destination(?=.*44B)'
  5. reg_ind = [(m.start(0),m.end(0)) for m in re.finditer(pat, txt,re.IGNORECASE | re.VERBOSE)]
  6. print(reg_ind)
Success #stdin #stdout 0.02s 9576KB
stdin
Standard input is empty
stdout
[(0, 41)]