Commit da38c969 authored by Drew's avatar Drew

Improve pattern documentation

parent fd9db9d3
......@@ -152,6 +152,12 @@ public enum RegexError: ErrorProtocol {
///We use an inner class as an implementation detail. It isn't actually mutable, but it's hard to convince Swift that.
private final class RegexImp {
private let regext: regex_t
///Create a regex following the given pattern.
///For regex syntax, consult the extended regular expression specification at
///For casual use, Boost has a particularly good guide:
///- note: There are two levels of indirection here. For Swift literals, Swift-level escaping is applied first (e.g. `\\` -> `\`).
/// Therefore to escape through both systems, you may need `\\\\`.
/// See Swift's documentation on this here
init(pattern: String) throws {
var lregext = regex_t()
let result = regcomp(&lregext, pattern, REG_EXTENDED)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment