wildstar
    Preparing search index...

    Function match

    • Matches a string against a pattern with wildcards and captures

      Parameters

      • source: string

        The input string to match

      • pattern: string

        The pattern string, may contain * and *+ wildcards

      • OptionalcharCompare: CharCompare

        Optional custom character comparison function

      Returns null | string[]

      Array of captures if matched, or null if not

      match('foo bar', 'foo *') // returns ['bar']
      match('hello world', 'h*o w*d') // returns ['ell', 'orl']
      match('no match', 'different') // returns null