Test, validate and match regular expressions
Matches a single digit (0-9) enclosed in square brackets, such as [0], [3], or [9], capturing the full bracketed token in group 1. The global flag ensures all occurrences are found throughout the input text rather than just the first match. Commonly used to extract footnote references, citation markers, or array index notations from documents, and is useful for locating or replacing numbered references.