UNPKG

@syntropiq/py-regex

Version:

Python-compatible regular expressions for TypeScript/JavaScript, mirroring Python's re/regex API.

19 lines 591 B
import { escapeRegex } from './escape.js'; export interface Match { group(nameOrIndex: string | number): string | undefined; groups: Record<string, string>; fullMatch: string; } export interface Pattern { fullmatch(text: string): Match | null; match(text: string): Match | null; search(text: string): Match | null; test(text: string): boolean; } declare function compile(pattern: string, flags?: string): Promise<Pattern>; export declare const regex: { compile: typeof compile; escape: typeof escapeRegex; }; export {}; //# sourceMappingURL=regex.d.ts.map