Build, test, and debug regular expressions
This regex matches chemical formula components, capturing either single element symbols (with optional lowercase letter) followed by a count, or groups enclosed in parentheses/brackets with an optional count. It supports counts as integers, decimals (using dot or comma), and percentages. Useful for parsing chemical formulas, validating molecular structures, and building calculators for molecular mass or stoichiometry.