matches

fun NameToken.matches(pattern: NameToken): Boolean

Checks if this token matches a given NameToken. The match successful if:

  • Token body matches pattern body as a regex

  • Index body matches pattern body as a regex of both are null

fun Name.matches(pattern: Name): Boolean

Matches all names in pattern according to NameToken.matches rules.

fun Name.matches(pattern: String): Boolean