Guitar

Undocumented

  • Designated Initializer for Guitar

    Declaration

    Swift

    public init(pattern: String)

    Parameters

    pattern

    The pattern that will be used to perform the match.

  • Delegating Initializer for Guitar

    Declaration

    Swift

    public init(chord: GuitarChord)

    Parameters

    chord

    The chord, or build-in regex pattern that will be used to perform the match.

  • Evaluates a string for all instances of a regular expression pattern.

    Declaration

    Swift

    public func evaluate(string: String, options: NSRegularExpression.Options = []) -> [Range<String.Index>]

    Parameters

    string

    The string that will be evaluated.

    options

    Regular expression options that are applied to the string during matching. Defaults to [].

    Return Value

    A list of matches.

  • Undocumented

  • Tests a string to see if it matches the regular expression pattern.

    Declaration

    Swift

    public func test(string: String, options: NSRegularExpression.Options = []) -> Bool

    Parameters

    string

    The string that will be evaluated.

    options

    Regular expression options that are applied to the string during matching. Defaults to [].

    Return Value

    true if string passes the test, otherwise, false.

  • Tests a string to check if it is a valid email address by using a regular expression.

    Declaration

    Swift

    static func isValidEmail(email: String) -> Bool

    Parameters

    email

    The string that needs to be evaluated.

    Return Value

    true if string is a valid email address, otherwise false.

  • Sanitizes of a string by removing all non-Alphanumeric characters (excluding whitespaces)

    Declaration

    Swift

    static func sanitze(string: String) -> String

    Parameters

    string

    The string that should be sanitized.

    Return Value

    The sanitized string.