Test, validate and match regular expressions
This regex validates a Chef role name, allowing only alphanumeric characters, hyphens, and underscores, with a length between 1 and 254 characters. With the multiline flag, it checks each line in a multiline string, ensuring every line conforms to this naming convention. It is commonly used for input validation in configuration management scripts or user interfaces where role names must follow strict constraints.