Test, validate and match regular expressions
This regex matches each node segment in an XPath expression by anchoring on forward slashes or line boundaries, optionally skipping a namespace prefix (e.g., 'ns:' in 'ns:element') and lazily capturing the node name in the named group 'node'. It is typically used with .NET's Regex.Replace to convert namespace-qualified XPath queries like /ns:root/ns:child into namespace-agnostic forms using local-name(), so element matching works regardless of XML namespace declarations.