Powerful perl paradigm I don't find in python

Charles T. Smith cts.private.yahoo at gmail.com
Mon Jan 18 08:05:50 EST 2016


On Fri, 15 Jan 2016 14:20:17 +0100, Wolfgang Maier wrote:

> pattern = pattern_str.compile()
> try:
>      matches = pattern.findall(some_str, endpos=some_str.index(tail))
> except ValueError:
>      # do something if tail is not found
>      pass

Oh!  I think that's it!


matches = findall (pattern, string)
for file in matches:
    use (file)

Totally cool!  Thank you.



More information about the Python-list mailing list