3
_tag_check = re.compile("^\w+[\w-]*$", re.UNICODE)
5
def is_valid_tag(tagname):
6
"""Return True if the tag meets our tag requirements."""
7
return _tag_check.match(tagname)
10
def is_valid_tag_list(tag_list):
11
"""Validate a tag_list string.
13
@param tag_list: string like london, server which will be split on the
14
commas and each tag verified for validity.
17
tags = [tag.strip() for tag in tag_list.split(",")]
19
if not is_valid_tag(tag):