Test, validate and match regular expressions
This regex matches a specific HTML/PHP template pattern: a span element with a dynamic CSS class (e.g., 'badge-success') containing a PHP echo count() statement. It captures the badge class name, the count argument, and the surrounding markup. This is useful for parsing or extracting badge counters from PHP-based templates, such as those in WordPress or Laravel, to identify where counts are displayed.