Test, validate and match regular expressions
This regex matches AsciiDoc anchor IDs of the form [#word] where word consists of word characters (letters, digits, underscores). With multiline and global flags, it finds all such anchors across lines. It captures the anchor name without the brackets, useful for extracting or validating document section identifiers in AsciiDoc source files. Common in scripting tools that process documentation.