Skip to main content

RegExp named capture groups

Less than 1 minutefeaturees-proposalmissing-example

RegExp named capture groupsopen in new window

Types

// patched for support `RegExp` named capture groups:
interface RegExp {
  new (pattern: RegExp | string, flags?: string): RegExp;
  exec(): RegExpExecResult | null;
  [Symbol.replace](string: string, replaceValue: Function | string): string;
}

interface RegExpExecResult extends Array<string> {
  groups?: {
    [key: string]: string;
  };
  index: number;
  input: string;
}

Entry points

core-js/proposals/regexp-named-groups