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

multiple slashes within a string not properly processed #40

Open
maia opened this issue Feb 4, 2019 · 0 comments
Open

multiple slashes within a string not properly processed #40

maia opened this issue Feb 4, 2019 · 0 comments

Comments

@maia
Copy link
Collaborator

maia commented Feb 4, 2019

A string containing multiple slashes will only be split by its last ocurrence of a slash:

string = "Washington/London/Paris/Tokyo"
PragmaticTokenizer::Tokenizer.new().tokenize(string)
=> ["washington/london/paris", "tokyo"]

This is caused by the NOT_URL regex, which is used in the SLASH_NOT_URL regex. When combining the sources, the resulting regex is the one used here. I hope someone can come up with a fix, as I forgot a lot about regex in the past months and cannot provide a quick fix myself.

See here:
https://rubular.com/r/scNIh27gBLIX03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant