Skip to content

Commit

Permalink
Use official semver regex
Browse files Browse the repository at this point in the history
Resolves #16.
  • Loading branch information
theory committed Feb 8, 2024
1 parent 2db9ef5 commit d69e0f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Revision history for Perl extension PGXN::API
- The indexer will now index a testing release if there are no stable
releases, and will index an unstable release if there are neither stable
nor testing releases (#2).
- Updated the SemVer regex when parsing rsync output to the official
version published in https://regex101.com/r/vkijKf/ (#16).

0.16.5 2016-06-22T18:03:05Z
- Fixed a test failure on systems with a non-English locale, thanks to
Expand Down
3 changes: 2 additions & 1 deletion lib/PGXN/API/Sync.pm
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ sub regex_for_uri_template {

my %regex_for = (
'{dist}' => qr{[^/]+?},
'{version}' => qr{(?:0|[1-9][0-9]*)(?:[.][0-9]+){2,}(?:-[a-z][-0-9a-z]*)?},
# https://regex101.com/r/vkijKf/
'{version}' => qr{(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?},
'{user}' => qr{([a-z]([-a-z0-9]{0,61}[a-z0-9])?)}i,
'{extension}' => qr{[^/]+?},
'{tag}' => qr{[^/]+?},
Expand Down

0 comments on commit d69e0f4

Please sign in to comment.