ZewoGraveyard / POSIXRegex

[Merged into Zewo/POSIX]

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

POSIXRegex

Swift Zewo Platform License Slack Travis Codebeat

POSIXRegex provides POSIX Regular Expressions for Swift 3.0.

Features

  • Matches
  • Groups
  • 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: 12),
    ]
)

Support

If you need any help you can join our Slack and go to the #help channel. Or you can create a Github issue in our main repository. When stating your issue be sure to add enough details, specify what module is causing the problem and reproduction steps.

Community

Slack

The entire Zewo code base is licensed under MIT. By contributing to Zewo you are contributing to an open and engaged community of brilliant Swift programmers. Join us on Slack to get to know us!

License

This project is released under the MIT license. See LICENSE for details.

About

[Merged into Zewo/POSIX]

License:MIT License


Languages

Language:Swift 100.0%