Skip to content

swiftyaf/RegexHelper

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

RegexHelper

RegexHelper is a simple wrapper for using regular expressions to extract data from strings in Swift. This is not a full-blown implementation, but rather a simple tool to cover basic use cases. For more examples of usage check the unit tests included.

Usage

    let helper = RegexHelper(pattern: #"\[(\d+)\]\D+(\d+)"#)
    let inputString = "mem[56248] = 21501"
    let result = helper.parse(inputString)
    print(result[0]) // 56248
    print(result[1]) // 21501

Adding RegexHelper as a Dependency

You can add RegexHelper to your project from Xcode. Select File > Swift Packages > Add Package Dependency..., and paste https://github.com/swiftyaf/RegexHelper.

About

RegexHelper is a simple wrapper for using regular expressions to extract data from strings in Swift.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages