made validate_regex test more portable