Python RegEx Meaning

Я новичок в регулярных выражениях Python, и мне было интересно, может ли кто-нибудь помочь мне, объяснив, что это означает (я выскажу, что я думаю здесь также означает каждый бит).

Спасибо!

RegExp:
r'(^.*def\W*)(\w+)\W*\((.*)\):'

r'...' = python definition of regular expression within the ''
(...) = a regex term
(^. = match the beginning of any character
*def\W* = ???
(\w+) = match any of [a, z] 1 or more times
\W*\ = ? i think its the same as the line above this but from 0+ more times instead of 1 but since it matches the def\W line above (which i dont really know the meaning of) i'm not sure.
((.*)\): = match any additional character within brackets ()

Спасибо!

10
задан noname 31 October 2011 в 18:14
поделиться