i'm trying to get a certain string from a code snippet. i'm using the re (regex) package, but there seems to be a small problem:
when i use the method findall() it works fine, it displays exactly what i want, but when i use match, it returns None.
this is the code i'm using:
Python Code:
import re
code = "private void handleUpdateConstructionRequestEvent( UpdateConstructionRequestEvent event)"
reg_method = re.compile('([A-Z][a-zA-Z0-9\._]+)\s?\(', re.S)
print "findall:"
print reg_method.findall(code)
print "match:"
print reg_method.match(code)
When i run it, i get this output:
does anybody have an idea why?
thx in advance,
UnrealEd