PyDocs

Nav

Text Processing Services

findall

re

function (source)
  • findall(pattern, string, flags=0)
Return a list of all non-overlapping matches in the string.

If one or more capturing groups are present in the pattern, return
a list of groups; this will be a list of tuples if the pattern
has more than one group.

Empty matches are included in the result.
Changed in 3.7
  • 3.7: Non-empty matches can now start just after a previous empty match.
1 Example
>>> re.findall(r'\bf[a-z]*', 'which foot or hand fell fastest')
['foot', 'fell', 'fastest']
>>> re.findall(r'(\w+)=(\d+)', 'set width=20 and height=10')
[('width', '20'), ('height', '10')]
from the Python docs
See Also
No see-alsos for re/findall
0 Notes
No notes for findall