Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle hyphens in dataset() #57

Merged
merged 3 commits into from
Nov 23, 2022
Merged

Handle hyphens in dataset() #57

merged 3 commits into from
Nov 23, 2022

Conversation

mortenpi
Copy link
Member

@mortenpi mortenpi commented Nov 23, 2022

When calling dataset("dataset-name"), it actually has its own regex it checks when it parses it (because of query parameters), and it doesn't currently handle hyphens.

I now try to reuse the regex string for the dataset name, rather than having two separate regexes that do partially the same thing.

It should also be backported to 0.2.


This is how the new regexes print:

julia> DataSets.DATASET_NAME_REGEX
r"^
[[:alpha:]]
(?:
    [-[:alnum:]_]     |
    / (?=[[:alpha:]])
)*

$"x

julia> DataSets.DATASET_SPEC_REGEX
r"^
([[:alpha:]]
(?:
    [-[:alnum:]_]     |
    / (?=[[:alpha:]])
)*
)
(?:\?([^#]*))? # query    - a=b&c=d
(?:\#(.*))?    # fragment - ...
$
"x

@mortenpi mortenpi requested a review from pfitzseb November 23, 2022 06:02
@mortenpi mortenpi added the bug Something isn't working label Nov 23, 2022
@mortenpi mortenpi merged commit 2b31808 into master Nov 23, 2022
@mortenpi mortenpi deleted the mp/fix-dataspec-hyphen branch November 23, 2022 19:47
mortenpi added a commit that referenced this pull request Nov 23, 2022
Handle hyphens in dataset() (#57)

Manually backported from commit 2b31808
@mortenpi mortenpi mentioned this pull request Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants