wildstar
    Preparing search index...

    Function remap

    • Matches a string against a pattern and replaces using the replacement string if matched

      Parameters

      • source: string

        The input string to match

      • pattern: string

        The pattern string, may contain * and *+ wildcards

      • replacement: string

        The replacement string, may contain <1>, <2>, ... for captures

      • OptionalcharCompare: CharCompare

        Optional custom character comparison function

      Returns null | string

      The replaced string if matched, or null if not matched

      remap('foo bar', '* bar', '<1> baz') // returns 'foo baz'
      remap('hello world', 'h* *', 'Hi <2>!') // returns 'Hi world!'
      remap('no match', 'different *', '<1>') // returns null