I am learning re in python.
I understand all other things in the following example.
but, i really dont understand what special (in tags) means in the following example.
re.compile('((?P<special>[0:-])\s)')
kindly help if know it.
They're called named capturing groups.
A quick explanation here:
Python's regex module was the first to offer a solution: named capture. By assigning a name to a capturing group, you can easily reference it by name. (?P<name>group) captures the match of group into the backreference "name". You can reference the contents of the group with the numbered backreference \1 or the named backreference (?P=name).