@types/named-regexp-groups
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

Installation

npm install --save @types/named-regexp-groups

Summary

This package contains type definitions for named-regexp-groups (https://github.com/commenthol/named-regexp-groups/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/named-regexp-groups.

index.d.ts

interface NamedRegExpExecArray extends RegExpExecArray {
    groups: { [propName: string]: string };
}

declare class NamedRegExp {
    constructor(pattern?: string | RegExp, flags?: string);

    /**
     * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.
     * @param string The String object or string literal on which to perform the search.
     */
    exec(string: string): NamedRegExpExecArray | null;

    /**
     * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.
     * @param string String on which to perform the search.
     */
    test(string: string): boolean;

    // Non-standard extensions
    toString(): string;

    [Symbol.replace](
        str: string,
        replacement: string | ((match: string, ...capturedGroups: string[]) => string),
    ): string;

    [Symbol.match](str: string): NamedRegExpExecArray;

    [Symbol.split](str: string): string[];

    [Symbol.search](str: string): number;
}

export = NamedRegExp;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by .

/@types/named-regexp-groups/

    Package Sidebar

    Install

    npm i @types/named-regexp-groups

    Weekly Downloads

    273

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    4.57 kB

    Total Files

    5

    Last publish

    Collaborators

    • types