Skip to content

Commit

Permalink
Merge pull request #74 from adafruit/regex-fix
Browse files Browse the repository at this point in the history
Modified regex to accept uppercase characters and a forward slash
  • Loading branch information
evaherrada committed Jun 10, 2021
2 parents 0f6b389 + fff49a2 commit 49d6f48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adafruit_io/adafruit_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ def validate_feed_key(feed_key):
if len(feed_key) > 128: # validate feed key length
raise ValueError("Feed key must be less than 128 characters.")
if not bool(
re.match(r"^[a-z0-9-]+(\.[a-z0-9-]+)?$", feed_key)
re.match(r"^[a-zA-Z0-9-]+((\/|\.)[a-zA-Z0-9-]+)?$", feed_key)
): # validate key naming scheme
raise TypeError(
"Feed key must contain lower case English letters, numbers, dash, and one period."
"Feed key must contain English letters, numbers, dash, and a period or a forward slash."
)


Expand Down

0 comments on commit 49d6f48

Please sign in to comment.