Skip to content

Commit

Permalink
Fix language name regex to allow spaces and a couple other edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-williams committed Jul 21, 2024
1 parent 3e9373a commit b84e90e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_data_languages.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"tlh_Latn": "Klingon is an artifical language.",
}

LANGUAGE_NAME_REGEX = "^[A-Za-z-]+(, [A-Za-z-]+)?( [(][A-Za-z-]+[)])?$"
LANGUAGE_NAME_REGEX = "^[A-Za-z'- ]+[ʼ]?(, [A-Za-z- ]+)?( [(][A-Za-z- ]+[)])?$"

Check warning

Code scanning / CodeQL

Overly permissive regular expression range Medium test

Suspicious character range that is empty.


@pytest.mark.parametrize("lang_code", LANGUAGES)
Expand Down

0 comments on commit b84e90e

Please sign in to comment.