DBRegex
DigitalblendKit provides Regex Sub Component to manage regular expression.
Instalation
Swift Package Manager
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. It is in early development, but Alamofire does support its use on supported platforms.
Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the dependencies value of your Package.swift.
dependencies: [
.package(url: "http://git.digitalblend.lan/Framework/DigitalblendKit-swift.git")
]
Usage
Import
import Digitalblend
Parse
First you need to retrive the formatter.
DBDate.formatter
Now you can work with regular expression.
// Date to String
let str = "Bonjour je suis le test."
let pat = "[[[\\w]+]+]+"
let strings = DBRegex.Parse(str, withPattern: pat) // strings: [String]?
print(strings) // strings = ["Bonjour", "je", "suis", "le", "test"]
Todo
- [ ]
DBRegex Reference