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
NSRegularExpressionOptions? #3
Comments
+1 for case (in)sensitivity |
Awesome. Are you interested in submitting a PR? I've been thinking a little about the API—here's what I've come up with, for posterity. I think this kind of thing is probably the most obvious: Regex("foo", caseSensitive: false)
Regex("foo", ignoreCase: true)
Regex("foo", options: [.IgnoreCase]) It has the downside of being a little wordy though. I'm not entirely opposed to using PCRE style options, specified as a second string: Regex("foo", "i") // => /foo/i It's not as user-friendly, but it's pretty standard these days, and I think the added brevity could be really nice. |
I vote for |
I'm on the |
I'm personally fairly happy with the defaults, but if there's enough demand for some options it would be good to look into.
Case (in)sensitivity is one consideration.
The text was updated successfully, but these errors were encountered: