typed-regex icon indicating copy to clipboard operation
typed-regex copied to clipboard

A typescript library for type-safe regex for named capture groups

Results 3 typed-regex issues
Sort by recently updated
recently updated
newest added

WIP. Will need to re-write the parser to work better with nested groups without nesting the types to its limits

Current: ```ts const regex = TypedRegEx("^\w+(@(?[a-z0-9-_.]+))?$", "gi"); const captures = regex.captures(...); // { version: string } | undefined; ``` Expected: ```ts const regex = TypedRegEx("^\w+(@(?[a-z0-9-_.]+))?$", "gi"); const captures = regex.captures(...);...

Description: If a named capture group has some optional grouping itself then the whole group is optional. Test case: Current: ```ts const regex = TypedRegEx("^(?((@\\w[-\\w]*\\/)?\\w[-\\w]*))$", "gi"); const captures = regex.captures(...)...