Test, validate and match regular expressions
This regular expression is designed to validate a masked phone number input field, specifically matching the format (XXX)XXX-XX-XX. It allows the placeholder character underscore (_) alongside digits, which is common in UI input masks that guide user entry. The pattern ensures the entire string exactly matches this structure, validating both incomplete inputs like (_)_-- and fully completed ones.