Skip to content

Commit

Permalink
Change regex validation to a one liner, simplify regex expression.
Browse files Browse the repository at this point in the history
  • Loading branch information
JCantu248 committed Oct 20, 2021
1 parent 0f15833 commit 0c1b476
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/util/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ def validate_assessment_id(assessment_id):
Returns:
match: the result of a regular expression match.
"""
pattern = re.compile("^RV([0-9]){4}")
match = pattern.match(assessment_id)
match = re.match(r"^RV\d{4}", assessment_id)

return match

Expand Down

0 comments on commit 0c1b476

Please sign in to comment.