Build, test, and debug regular expressions
Matches chemical formula components: an element symbol (an uppercase letter optionally followed by a lowercase letter, like H, Na, or Cl) with an optional count, or a parenthesized group with a required multiplier such as (OH)2 or (NO3)2. With the global flag, it tokenizes molecular formulas like H2O, Ca(OH)2, and Mg(NO3)2 into elements and groups, useful for parsing, validating, or counting atoms in chemical notation.