【发布时间】:2011-10-31 18:14:01
【问题描述】:
我是 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 ()
谢谢!
【问题讨论】:
-
+1 用于展示您尝试过的内容
-
另外,这些是否会导致出现空白?