MatchesVersionType🔗

Type: Pattern verification
Check that text is a valid version string.

Code

pattern = f"^(0|[1-9][0-9]*)$"

return match(pattern, text) is not None