What does the following grammar mean?
pa = re.compile("(?P<A>\w+)(?:\[(?P<B>\d+):(?P<C>\d+)\]|\[(?P<D>\d+)\])?")
I know what this means => (?P<A>\w+) (?P<D>\d+)
But I don't know the meaning of the whole grammar. Can someone please elaborate?
What does the following grammar mean?
pa = re.compile("(?P<A>\w+)(?:\[(?P<B>\d+):(?P<C>\d+)\]|\[(?P<D>\d+)\])?")
I know what this means => (?P<A>\w+) (?P<D>\d+)
But I don't know the meaning of the whole grammar. Can someone please elaborate?