RegexDefinitions

struct RegexDefinitions

Regex definitions to parse a chord

Regex to parse a chord name

  • The regex for a chord string

    It will parse the chord to find the root and optional quality

    /// ## Examples
    
    Am -> root: Am, quality: m
    Dsus4 -> root: D, quality: sus4
    

    Declaration

    Swift

    let chordRegex: Regex<Regex<(Substring, Chord.Root, Chord.Quality?, Chord.Root?)>.RegexOutput>

Regex to parse a define

  • The regex for a chord definition

    Declaration

    Swift

    let defineRegex: Regex<Regex<(Substring, String, Int?, String?, String?)>.RegexOutput>

Regex to parse the root of a chord

  • The regex to parse the root of a chord

    Declaration

    Swift

    static var rootRegex: Capture<(Substring, Chord.Root)> { get }