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

runtime exception in Regex.regex #912

Closed
dave-doty opened this Issue Oct 2, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@dave-doty

dave-doty commented Oct 2, 2017

The function regex : String -> Regex creates a Elm Regex from a String. If given an invalidly formatted regex string, for example, "0)", it throws a runtime exception.

Perhaps this is expected behavior, since regex returns a Regex instead of a Result _ Regex? So perhaps this is a feature request to alter the return type to return Err _ if the input has bad syntax, or at least give some way to test whether a String is a valid Javascript regular expression before calling the regex function.

@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Oct 2, 2017

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.

process-bot commented Oct 2, 2017

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.

@dave-doty

This comment has been minimized.

Show comment
Hide comment
@dave-doty

dave-doty Oct 2, 2017

Sorry, I just noticed that this will be fixed in Elm 0.19:

https://github.com/elm-lang/core/issues/722

dave-doty commented Oct 2, 2017

Sorry, I just noticed that this will be fixed in Elm 0.19:

https://github.com/elm-lang/core/issues/722

@dave-doty dave-doty closed this Oct 2, 2017

@evancz

This comment has been minimized.

Show comment
Hide comment
@evancz

evancz Oct 3, 2017

Member

Yep, looking forward to that :)

Member

evancz commented Oct 3, 2017

Yep, looking forward to that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment