Guitar
Undocumented
-
Common Regular Expression Patterns
See moreDeclaration
Swift
public struct Chord
-
Designated Initializer for GuitarRegex
Declaration
Swift
public init(chord: String)
Parameters
chord
The pattern (also known as a
chord
) that will be used to perform the match. Common patterns (or chords) can be found in theChord
struct.Return Value
A list of matches.
-
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
ifstring
is a valid email address, otherwisefalse
. -
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.