Repository: ARMmbed/yotta

Issue:
Semver incompatibility
Hi,

It seems the recent version has broken semantic version for any previous version, which we heavily use in our project, [microbit-dal](https://github.com/lancaster-university/microbit-dal).

We have had two new users on v18 who have reported this breakage: https://github.com/lancaster-university/microbit-dal/issues/282

Any help would be greatly appreciated :smile:

Discussion:

Patch:
diff --git a/yotta/lib/sourceparse.py b/yotta/lib/sourceparse.py
index 0f451ad..eb1f0b4 100644
--- a/yotta/lib/sourceparse.py
+++ b/yotta/lib/sourceparse.py
@@ -57,7 +57,7 @@ def _getNonRegistryRef(source_url):
     # something/something#spec = github
     # something/something@spec = github
     # something/something spec = github
-    github_match = re.match('^([.a-z0-9_-]+/([.a-z0-9_-]+)) *[@#]?([.a-z0-9_\-\*\^\~\>\<\=]*)$', source_url, re.I)
+    github_match = re.match(r'^([.a-z0-9_-]+/([.a-z0-9_-]+)) *[@#]?([^/:\?\[\\]*)$', source_url, re.I)
     if github_match:
         return github_match.group(2), VersionSource('github', github_match.group(1), github_match.group(3))
 


Test patch:
diff --git a/yotta/test/test_sourceparse.py b/yotta/test/test_sourceparse.py
index 0b7af6f..2c421ba 100644
--- a/yotta/test/test_sourceparse.py
+++ b/yotta/test/test_sourceparse.py
@@ -47,6 +47,7 @@ Git_Specs = [
     '~1.2.3',
     '-1.2.3',
     'branch-or-tag-name',
+    'branch+or+tag+name',
     'd5f5049',
 ]