-
Notifications
You must be signed in to change notification settings - Fork 368
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
Regular expression support #85
Comments
Thanks! Yes it makes sense to add helper methods for regex or even creating extensions for NSRegularExpression in the Cent library if it makes sense. Let me know if you need help implementing. |
How do you determine which APIs should be in Dollar and which should be extensions in Cent? We could do something for regular expressions like: or this maybe? "data to test against".match("^some sort of regex$") Each API could accept both a string and an NSRegularExpression object. Thoughts? |
I have created a Swift port of VerbalExpressions: https://github.com/VerbalExpressions/SwiftVerbalExpressions |
VertbalExpressions looks really good, nubbel; I'll try it out. I think having basic regular expression support in Dollar is still valuable though. |
I would make a functional method in Dollar and have the String class extension implement a match method using the functional implementation imported from Dollar |
Made any progress with this or need some help? |
Hey ankurp, sorry, I haven't had much time. I'll try to get you a pull request tomorrow. :) Sorry for the wait. |
@coryroloff No problem. Let me know if you run into any issues running tests as currently I am not able to get the test to run due to Swift and SourceKit hogging all of the CPU and memory in Xcode Beta5 |
I run into the same issue, but I commented out the other tests for now. Unfortunately, Beta5 is throwing an exception with the NSRegularExpression class, which Beta4 had no trouble with. Even just running this example of using NSRegularExpression causes the runtime to fail. It throws an exception on the "regex.matchesInString" method (and the other match methods as well) with the error: dyld: lazy symbol binding failed: Symbol not found: _objc_readClassPair Have you run into this issue before? var error: NSError? let string = "data to match" assert(error == nil) var matches = regex.matchesInString(string, options: nil, range: NSMakeRange(0, countElements(string))) |
Done |
Just curious if you would consider adding helpers for NSRegularExpression. Apple's regex library is good, but it's a painful API to use and maintain. Otherwise, loving the library you've built!
The text was updated successfully, but these errors were encountered: