PatternElement

public protocol PatternElement

MatchElements are used by Matcher instances to be able to recognise patterns. Currently, the two main kind of MatchElement classes are Keywords and Variables

  • Using this method, an element returns how much the String provided in the prefix parameter matches the current element

    Declaration

    Swift

    func matches(prefix: String, options: PatternOptions) -> MatchResult<Any>

    Parameters

    prefix

    The input

    options

    Options that modify the matching algorithm

    Return Value

    The result of the match operation