We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I was playing with Regex.find and I wanted to find all matches for [a-z0-9] so I wrote the regex ([a-z0-9]*).
I wrote it in Elm and ran it in the repl
> (Regex.find Regex.All (regex "([a-z0-9]*)") "simon er en banan en") [{ match = "simon", submatches = [Just "simon"], index = 0, number = 1 }] : List Regex.Match
So this only return one match. I got some help, and after change the regex to [a-z0-9]+ instead of [a-z0-9]* witch now work like I wanted.
I started to wonder if this is a bug or not? I check what would happen if I tested in the browser.
"simon er en banan en".match(/([a-z0-9]*)/g) => ["simon", "", "er", "", "en", "", "banan", "", "en", ""]
This is not exactly what I wanted but I think the elm method should return the same.
I checked a the source and found that Native/Regex.js#L34 is the line witch stops it from finding more matches. This line was added in https://github.com/elm-lang/core/pull/156 to stop a infinity loop.
The text was updated successfully, but these errors were encountered:
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
Sorry, something went wrong.
Regex.find
No branches or pull requests
I was playing with Regex.find and I wanted to find all matches for [a-z0-9] so I wrote the regex ([a-z0-9]*).
I wrote it in Elm and ran it in the repl
So this only return one match. I got some help, and after change the regex to [a-z0-9]+ instead of [a-z0-9]* witch now work like I wanted.
I started to wonder if this is a bug or not? I check what would happen if I tested in the browser.
This is not exactly what I wanted but I think the elm method should return the same.
I checked a the source and found that Native/Regex.js#L34 is the line witch stops it from finding more matches. This line was added in https://github.com/elm-lang/core/pull/156 to stop a infinity loop.
The text was updated successfully, but these errors were encountered: