String

struct String
  • The function to check if given regex matches the string.

    Usage Example

    let aNumberString = "1234567890"
    if try! aNumberString.doesRegexMatch("[^0-9]") == true {
       Swift.print("Invalid number.")
    } else {
       Swift.print("Valid number.")
    }
    

    Declaration

    Swift

    public func doesRegexMatch(_ pRegexPattern :String) throws -> Bool