Perl to python ... how to do this?

I am trying to learn python but don't quite understand the syntax. Which is equivalent:

my $string='this one this that this here '; while($string=~/this\s+(.*?)\s+/g){ print $1."\n"; } 

Fingerprints:

 one that here 
+4
source share
1 answer

Try the re module. I think this is equivalent, compared to some side effects on string :

 import re string = "this one this that this here " for match in re.finditer(r"this\s+(.*?)\s+", string): print match.group(1) 
+7
source

All Articles