I have this patter p
and want to use this pattern to find if it has any matching. This is in Python.
p = "keyword" + ".*?(\d+(\.\d+)?[\s%]?[\w/]*)"
found = re.findall(p, some_text)
I have problem parsing this regex.
What is the first "?".
I understand that ".*" matches any thing for 0 or more times. But not sure what the "?" does here.
It is weird to see nested capture group parenthesis. What does it do?
What is the "?" in
[\s%]?
regex? I assume this is matching white space followed by "%". But not sure what the "?" does here.What is the asterisk in
[\w/]*
regex? I assume this is matching any word character followed by forward slash. But not sure what the "*" does.