@syntropiq/py-regex
Version:
Python-compatible regular expressions for TypeScript/JavaScript, mirroring Python's re/regex API.
16 lines • 724 B
TypeScript
import { PCRERegex } from '@syntropiq/libpcre-ts';
/**
* Convert Python named capture groups (?P<name>...) to PCRE format (?<name>...)
*/
export declare function convertNamedGroups(pattern: string): string;
/**
* Compile a PCRE regex with fullmatch semantics (like Python's re.fullmatch).
* Anchors the pattern at both ends and uses ANCHORED, UTF8, and UNICODE options.
*/
export declare function compileRegex(pattern: string): Promise<PCRERegex>;
/**
* Compile a regex pattern using PCRE without fullmatch anchoring
* Useful for partial matching or when you want to control anchoring manually
*/
export declare function compileRegexPartial(pattern: string): Promise<PCRERegex>;
//# sourceMappingURL=compile.d.ts.map