Latest 1.0.0
Homepage https://github.com/VSRegex/VSRegex-Swift
License MIT
Platforms ios 8.0, osx 10.9, watchos 2.0, tvos 9.0
Authors

ChinaMobilePhoneNumberRegex wrappers for iOS and macOS in Swift.

Usage

let regex = VSRegex() // Match all numbers by default.
let isMatch = regex.matches("+8613800138000")
print(isMatch) // true

let regex = VSRegex(.carrier(.chinaTelecom))
let isMatch = regex.matches("+8613800138000")
print(isMatch) // false

let isMatch = VSRegex.matches("+8613800138000")
print(isMatch) // true

let isMatch = VSRegex.is("+8613800138000", matches: .carrier(.chinaMobile))
print(isMatch) // true

...

Installation

CocoaPods

pod 'VSRegex', '~> 1.0.0'

License

MIT

Latest podspec

{
    "name": "VSRegex",
    "version": "1.0.0",
    "summary": "Regular expressions that match the mobile phone number in mainland China.",
    "homepage": "https://github.com/VSRegex/VSRegex-Swift",
    "license": "MIT",
    "authors": {
        "VincentXue": "[email protected]"
    },
    "social_media_url": "https://twitter.com/SuetFungSit",
    "platforms": {
        "ios": "8.0",
        "osx": "10.9",
        "watchos": "2.0",
        "tvos": "9.0"
    },
    "swift_version": "4.2",
    "source": {
        "git": "https://github.com/VSRegex/VSRegex-Swift.git",
        "tag": "1.0.0"
    },
    "source_files": "Sources/VSRegex.swift",
    "resource_bundles": {
        "VSRegex": [
            "Sources/Resources/regex.json"
        ]
    }
}

Pin It on Pinterest

Share This