0

I am relatively new to python just wanted to understand

import re
s=" the current process is well established by client"
re.findall(r"current process|current",s)

The output returns only "current process" and does not treat current separately. I wanted to get "current process" and "current". Not sure if I am doing anything incorrect.what is the alternative to achieve this if re.findall is not the right approach

I tried different combinations using word boundary, using re.X ,re.finditer etc but nothing seem to work

rochard4u
  • 629
  • 3
  • 17
  • Does this answer your question? [How to find overlapping matches with a regexp?](https://stackoverflow.com/questions/11430863/how-to-find-overlapping-matches-with-a-regexp) – rochard4u Jun 06 '23 at 09:26
  • Thanks for sharing. But the above link didn't give me required output – vikram santhanam Jun 06 '23 at 09:39
  • Found the required answer in another stackoverflow link https://stackoverflow.com/questions/41045008/return-all-overlapping-patterns-using-re-findall-in-python – vikram santhanam Jun 06 '23 at 09:40

0 Answers0