Definition:
Back to the main index of this glossary
When a colon is placed after a question mark and the two are placed within parentheses, Python matches the word which contains the first match of the pattern and disregard the rest. If the regex is part of an assignment, the matching object will have a method group() which is used to access the value of the object. group returns the matching value when given an argument of '0' and the pattern that matches the colon-offset regex when given an argument of '1'.
Back to the main index of this glossary

