Latest 0.1
Homepage https://github.com/Zewo/POSIXRegex
License MIT
Platforms ios 8.0, osx 10.9, requires ARC
Authors

Swift 2.2
Platforms Linux
License MIT
Slack Status

POSIXRegex provides POSIX Regular Expressions for Swift 2.2.

Features

  • [x] Matches
  • [x] Groups
  • [x] Replace

Usage

import POSIXRegex

let regex = try! Regex(pattern: "hello")
regex.matches("hello") // true
regex.matches("bye") // false

let regex = try! Regex(pattern: "(hello)")
regex.groups("hello") // ["hello"]
regex.groups("bye") // []

let regex = try! Regex(pattern: "(hello) (world)")
let groups = regex.groups("hello world") // ["hello", "world"]

let regex = try! Regex(pattern: "hello")
regex.replace("hello world", withTemplate: "bye") // "bye world"

Installation

  • Add POSIXRegex to your Package.swift
import PackageDescription

let package = Package(
    dependencies: [
        .Package(url: "https://github.com/Zewo/POSIXRegex.git", majorVersion: 0, minor: 2)
    ]
)

Community

Slack

Join us on Slack.

License

POSIXRegex is released under the MIT license. See LICENSE for details.

Latest podspec

{
    "name": "POSIXRegex",
    "version": "0.1",
    "license": "MIT",
    "summary": "POSIX Regular Expressions for Swift 2 (Linux ready)",
    "homepage": "https://github.com/Zewo/POSIXRegex",
    "authors": {
        "Paulo Faria": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Zewo/POSIXRegex.git",
        "tag": "0.1"
    },
    "platforms": {
        "ios": "8.0",
        "osx": "10.9"
    },
    "source_files": [
        "Dependencies/Gamut/*.c",
        "POSIXRegex/**/*.swift"
    ],
    "xcconfig": {
        "SWIFT_INCLUDE_PATHS": "$(SRCROOT)/POSIXRegex/Dependencies"
    },
    "preserve_paths": "Dependencies/*",
    "requires_arc": true
}

Pin It on Pinterest

Share This