Comments (10)
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.
from dollar.
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?
from dollar.
I have created a Swift port of VerbalExpressions: https://github.com/VerbalExpressions/SwiftVerbalExpressions
Would that be something for you or is it too much sugar?
from dollar.
VertbalExpressions looks really good, nubbel; I'll try it out. I think having basic regular expression support in Dollar is still valuable though.
from dollar.
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
from dollar.
Made any progress with this or need some help?
from dollar.
Hey ankurp, sorry, I haven't had much time. I'll try to get you a pull request tomorrow. :) Sorry for the wait.
from dollar.
@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
from dollar.
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"
let regex = NSRegularExpression(pattern: ".*", options: nil, error: &error)
assert(error == nil)
var matches = regex.matchesInString(string, options: nil, range: NSMakeRange(0, countElements(string)))
from dollar.
Done
from dollar.
Related Issues (20)
- Latest version doesn't work with Carthage HOT 2
- Update README/docs
- Add function for swapping elements in collection HOT 1
- Tag a release for Linux support HOT 7
- Why support only 10.1 as minimum deployment target? HOT 10
- How do you use this with Cordova swift projects? HOT 1
- multi-dimensional array flatten(my wrong)
- Swift 3.1 compatibility HOT 2
- Difference with iterator HOT 2
- Implement debounce HOT 4
- Where's String#strip()? HOT 4
- Swift 4 support
- I am getting $ is not identifier issue in XCode HOT 1
- Proposal: Array's fullfill function HOT 1
- Project Warnings: Use 'compactMap' Instead Of 'flatMap' HOT 1
- Update!!!!!!!! HOT 5
- Swift 5 support HOT 1
- Distribute to test flight failed with Carthage
- Question: Why would you not want to extend built-in objects?
- Update Package.swift to Support Swift Package Manager HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dollar.