{"id":50311232,"url":"https://github.com/fajarnugraha37/ts-rex","last_synced_at":"2026-05-28T21:01:34.988Z","repository":{"id":357319412,"uuid":"1236307262","full_name":"fajarnugraha37/ts-rex","owner":"fajarnugraha37","description":"A Drizzle-inspired, fluent-API Regex builder for modern TypeScript. Automatically infers named capture group types, ensures stateless execution, and supports the latest ES2024 features including Unicode sets.","archived":false,"fork":false,"pushed_at":"2026-05-12T08:02:33.000Z","size":7075,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-12T10:07:37.913Z","etag":null,"topics":["fluent-api","regex","regex-match","regex-pattern","regexp","typescript"],"latest_commit_sha":null,"homepage":"https://nugrahafajar.my.id/ts-rex","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fajarnugraha37.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-12T06:12:01.000Z","updated_at":"2026-05-12T08:05:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/fajarnugraha37/ts-rex","commit_stats":null,"previous_names":["fajarnugraha37/ts-rex"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fajarnugraha37/ts-rex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajarnugraha37%2Fts-rex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajarnugraha37%2Fts-rex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajarnugraha37%2Fts-rex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajarnugraha37%2Fts-rex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fajarnugraha37","download_url":"https://codeload.github.com/fajarnugraha37/ts-rex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fajarnugraha37%2Fts-rex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33626142,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fluent-api","regex","regex-match","regex-pattern","regexp","typescript"],"created_at":"2026-05-28T21:01:33.883Z","updated_at":"2026-05-28T21:01:34.959Z","avatar_url":"https://github.com/fajarnugraha37.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Type-Safe Regex (TS-Rex) without the headache\n\n[![NPM Version](https://img.shields.io/npm/v/@fajarnugraha37/ts-rex.svg)](https://www.npmjs.com/package/@fajarnugraha37/ts-rex) [![JSR Version](https://jsr.io/badges/@fajar/ts-rex)](https://jsr.io/@fajar/ts-rex)\n\n\u003ch1 align=\"center\"\u003e\n  \u003ca href=\"https://github.com/fajarnugraha37/ts-rex\"\u003e\n    \u003cpicture\u003e\n      \u003cimg height=\"500\" alt=\"TS-Rex Logo\" src=\"https://raw.githubusercontent.com/fajarnugraha37/ts-rex/refs/heads/main/assets/logo.png\"\u003e\n    \u003c/picture\u003e\n  \u003c/a\u003e\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cem\u003e\u003cb\u003eTS-Rex\u003c/b\u003e is a zero-dependency, meta-programming utility designed to eliminate the brittleness of standard JavaScript RegExp matching. Inspired by Drizzle ORM, it enables developers to construct complex regular expressions through an intuitive chainable API while statically inferring the exact shape of named capturing groups and execution outputs at compile time.\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://ts-rex.nugrahafajar.my.id/\"\u003e\u003cb\u003eRead the Official Documentation\u003c/b\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## Tech Stack\n\n- [![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue.svg)](https://www.typescriptlang.org/): The core logic and advanced generic type system.\n- [![Bun](https://img.shields.io/badge/Bun-1.0+-green.svg)](https://bun.sh/): Used for dependency management, test running, and linting.\n- **tsup**: Bundler for UMD, CJS, ESM, and type declarations.\n- **expect-type**: Static type assertion utility for unit testing.\n\n## Architecture\n\nTS-Rex is not intended to beat raw `RegExp` literals in hot-path microbenchmarks. Its primary value is **correctness, composability, type-safe captures, and safer regex construction**.\n\n\u003e [!NOTE]\n\u003e In most common scenarios, the overhead is measured in nanoseconds. However, the Bun extremely-complex case exposes a remaining optimization target, likely around generated pattern shape, capture access strategy, or JavaScriptCore-specific object allocation behavior.\n\nTS-Rex is built upon four architectural pillars:\n\n1. **AST Generation**: Instead of manipulating strings that can easily become malformed, every chained method appends an AST node to an internal array.\n2. **Immutability**: Each method call creates and returns a completely new `RegexBuilder` instance. This allows you to safely branch regex definitions (e.g., saving a base pattern into a variable and extending it multiple times) without unintended side effects.\n3. **Phantom Type State**: As you chain methods like `.capture()`, `.optional()`, or `.or()`, TypeScript infers and records the resulting group names and optionality within the generic state. This happens entirely during compilation, imposing **zero** runtime memory overhead.\n4. **Runtime Compilation**: Calling `.compile()` collapses the AST into a native JavaScript `RegExp` instance and binds the execution context flags, returning a strict type-safe execution wrapper.\n\n## Features\n\n- **Fluent API**: Chain methods to build regex patterns programmatically.\n- **Static Type Inference**: Named capturing groups are automatically inferred as strongly-typed objects at compile time.\n- **Stateless Execution**: The `.exec()` wrapper is externally stateless: repeated calls do not leak `lastIndex` state to the caller. Internally, single-match execution may reuse a private, cached `RegExp` instance for performance. Global iteration uses an isolated `RegExp` instance per iterator to avoid cross-iterator state corruption.\n- **Deep Optionality**: Quantifiers (`.optional()`, `.zeroOrMore()`) and alternations (`.or()`) correctly map captured properties to `Partial` or union types.\n- **Zero Dependencies**: Built entirely on standard TypeScript and native `RegExp`.\n\n## Core Entities\n\nTo effectively use this library, you should understand these core entities:\n\n- `rx()`: The factory function that initializes a fresh, empty builder.\n- `RegexBuilder`: The immutable builder class. Exposes dozens of chainable, strictly-typed methods (`.literal()`, `.digit()`, `.capture()`, etc.).\n- `CompiledRegex`: The object returned by `.compile()`. It contains:\n  - `pattern`: The raw string representation of the regex.\n  - `native`: The native JavaScript `RegExp` instance.\n  - `exec(string)`: The type-safe extractor method.\n- `MatchResult`: The discriminated union returned by `.exec()`.\n  - On failure: `{ isMatch: false, match: null, [captureName]: undefined }`\n  - On success: `{ isMatch: true, match: string, ...[Your Captures] }`. (If the `.global()` flag is set, this becomes an `IterableIterator` of successful matches).\n\n## Philosophy: Auto-Escaping and Safety First\n\nTo protect from malformed regular expressions, `ts-rex` heavily enforces **Automatic Escaping**.\n\nIf you use `.literal('http://')` or `.anyOf('a-z')`, the library will automatically escape all special regex characters. For example, `rx().anyOf('a-z')` complies to `[a\\-z]`, meaning it searches for the literal characters \"a\", \"-\", and \"z\", **not** a range.\n\n\u003e [!WARNING]  \n\u003e Do not attempt to inject raw regex strings into builder methods. To build complex character classes (like `[a-zA-Z0-9.-]`), you must compose them using the type-safe methods:\n\u003e\n\u003e ```typescript\n\u003e // Correct way to compose ranges\n\u003e const myClass = rx()\n\u003e   .range(\"a\", \"z\")\n\u003e   .or(rx().range(\"A\", \"Z\"))\n\u003e   .or(rx().range(\"0\", \"9\"))\n\u003e   .or(rx().anyOf(\".-\"));\n\u003e // Compiles to: (?:(?:(?:[a-z]|[A-Z])|[0-9])|[.\\-])\n\u003e ```\n\u003e\n\u003e This verbose compilation behaves 100% identically to `[a-zA-Z0-9.-]` in regex engines but guarantees syntactic safety.\n\n\u003e [!NOTE]\n\u003e If you find the strict composition syntax too limiting and need to inject raw, unescaped regex strings, `ts-rex` provides two escape hatches for power users:\n\u003e\n\u003e 1. **`.rawClass(str: string)`**: Generates `[str]` exactly as typed without any auto-escaping protection. (Example: `rx().rawClass('a-zA-Z0-9.-')` -\u003e `[a-zA-Z0-9.-]`).\n\u003e 2. **`.raw\u003cNewCaptures\u003e(str: string)`**: Allows you to freely inject any raw regex pattern directly into the AST. The optional generic parameter allows you to manually register named capture groups for full type safety.\n\u003e\n\u003e ```typescript\n\u003e const parser = rx().raw\u003c{ userId: string }\u003e(\"(?\u003cuserId\u003e\\\\d+)\").compile();\n\u003e ```\n\n## Getting Started\n\n### Installation\n\n```bash\n# via npmjs\nbun add @fajarnugraha37/ts-rex\nnpm install @fajarnugraha37/ts-rex\npnpm add @fajarnugraha37/ts-rex\n\n# via jsr\nbunx jsr add @fajar/ts-rex\nnpx jsr add @fajar/ts-rex\npnpm i jsr:@fajar/ts-rex\n```\n\n\u003e [!NOTE]  \n\u003e This library requires TypeScript version 5.0 or higher for full advanced type inference support.\n\n## Usage\n\n### Basic Capturing\n\nNamed capture groups automatically populate the output signature of `.exec()`.\n\n```typescript\nimport { rx } from \"@fajarnugraha37/ts-rex\";\n\n// Build a pattern\nconst pattern = rx()\n  .startOfInput()\n  .capture(\"firstName\", rx().oneOrMore(rx().wordChar()))\n  .whitespace()\n  .capture(\"lastName\", rx().oneOrMore(rx().wordChar()))\n  .endOfInput()\n  .compile();\n\n// Execute the pattern\nconst result = pattern.exec(\"John Doe\");\n\nif (result.isMatch) {\n  // Types are fully inferred based on the captures defined above\n  console.log(result.firstName); // \"John\"\n  console.log(result.lastName); // \"Doe\"\n  console.log(result.match); // \"John Doe\" (The full match)\n}\n```\n\n### Global Iteration\n\nFlags dynamically modify the return type of `.exec()`. Using the `.global()` flag changes the result from a single object to an `IterableIterator`. Execution is fully stateless to avoid native `lastIndex` bugs.\n\n```typescript\nconst pattern = rx()\n  .capture(\"num\", rx().oneOrMore(rx().digit()))\n  .global()\n  .compile();\n\nconst results = pattern.exec(\"I have 3 apples and 42 bananas\");\n\nfor (const result of results) {\n  console.log(result.num); // \"3\", \"42\"\n}\n```\n\n### Match Indices\n\nUsing the `.withIndices()` flag (ECMAScript `d` flag) injects an `indices` property containing `[start, end]` tuples for the full match and every captured group.\n\n```typescript\nconst pattern = rx().capture(\"val\", rx().wordChar()).withIndices().compile();\n\nconst result = pattern.exec(\"a\");\n\nif (result.isMatch) {\n  console.log(result.indices.match); // [0, 1]\n  console.log(result.indices.val); // [0, 1]\n}\n```\n\n### Alternation and Optionality\n\nUsing `.or()` creates a union type, ensuring mutually exclusive access to capturing groups.\n\n```typescript\nconst pattern = rx()\n  .capture(\"a\", rx().literal(\"A\"))\n  .or(rx().capture(\"b\", rx().literal(\"B\")))\n  .compile();\n\nconst result = pattern.exec(\"A\");\n\nif (result.isMatch) {\n  // TypeScript enforces that either 'a' is a string and 'b' is undefined, or vice versa.\n  console.log(result.a);\n}\n```\n\n## Supported Regex Operations and Tokens\n\n`ts-rex` supports almost the entire ECMAScript (ES2024) Regular Expression syntax.\n\n### Assertions and Boundaries\n\n| Regex    | API Method                     | Description                                  |\n| :------- | :----------------------------- | :------------------------------------------- |\n| `^`      | `.startOfInput()`              | Matches the beginning of the input.          |\n| `$`      | `.endOfInput()`                | Matches the end of the input.                |\n| `\\b`     | `.wordBoundary()`              | Matches a word boundary.                     |\n| `\\B`     | `.nonWordBoundary()`           | Matches a non-word boundary.                 |\n| `(?=y)`  | `.lookahead(builder)`          | Matches only if followed by the pattern.     |\n| `(?!y)`  | `.negativeLookahead(builder)`  | Matches only if NOT followed by the pattern. |\n| `(?\u003c=y)` | `.lookbehind(builder)`         | Matches only if preceded by the pattern.     |\n| `(?\u003c!y)` | `.negativeLookbehind(builder)` | Matches only if NOT preceded by the pattern. |\n\n### Character Classes and Escapes\n\n| Regex      | API Method                  | Description                                              |\n| :--------- | :-------------------------- | :------------------------------------------------------- |\n| `.`        | `.anyChar()`                | Matches any single character.                            |\n| `\\d`       | `.digit()`                  | Matches any digit (0-9).                                 |\n| `\\D`       | `.notDigit()`               | Matches any character that is not a digit.               |\n| `\\w`       | `.wordChar()`               | Matches any alphanumeric character.                      |\n| `\\W`       | `.notWordChar()`            | Matches any non-word character.                          |\n| `\\s`       | `.whitespace()`             | Matches a single white space character.                  |\n| `\\S`       | `.notWhitespace()`          | Matches a single non-white space character.              |\n| `[abc]`    | `.anyOf('abc')`             | Matches any enclosed character (auto-escapes internals). |\n| `[^abc]`   | `.noneOf('abc')`            | Matches anything not enclosed.                           |\n| `[a-z]`    | `.range('a', 'z')`          | Matches a character in the specified range.              |\n| `\\xNN`     | `.hex('NN')`                | Matches a character by its 2-digit hex code.             |\n| `\\uNNNN`   | `.unicodeChar('NNNN')`      | Matches a character by its 4-digit Unicode hex value.    |\n| `\\u{N}`    | `.unicodeCodePoint('NNNN')` | Matches a Unicode code point.                            |\n| `\\p{P}`    | `.unicodeProperty('...')`   | Matches a character based on its Unicode category.       |\n| `\\n`, `\\t` | `.newline()`, `.tab()`, etc | Named control characters.                                |\n\n### Quantifiers\n\n| Regex   | API Method                | Description                                                 |\n| :------ | :------------------------ | :---------------------------------------------------------- |\n| `*`     | `.zeroOrMore(builder)`    | Matches 0 or more times. Maps nested captures to `Partial`. |\n| `+`     | `.oneOrMore(builder)`     | Matches 1 or more times.                                    |\n| `?`     | `.optional(builder)`      | Matches 0 or 1 times. Maps nested captures to `Partial`.    |\n| `{n}`   | `.times(n, builder)`      | Matches exactly \"n\" occurrences.                            |\n| `{n,}`  | `.atLeast(n, builder)`    | Matches at least \"n\" occurrences.                           |\n| `{n,m}` | `.between(n, m, builder)` | Matches between \"n\" and \"m\" occurrences.                    |\n| `*?`    | `.lazy()`                 | Appended to quantifiers to make them non-greedy.            |\n\n### Groups and Logic\n\n| Regex     | API Method               | Description                                                 |\n| :-------- | :----------------------- | :---------------------------------------------------------- |\n| `(?:x)`   | `.group(builder)`        | Non-capturing group.                                        |\n| `(?\u003cN\u003ex)` | `.capture('N', builder)` | Named capturing group. Extracts to the TS output object.    |\n| `\\k\u003cN\u003e`   | `.matchPrevious('N')`    | Matches exact text captured previously. Statically checked. |\n| `x\\|y`    | `.or(builder)`           | Matches either branch. Resolves to a TS Union type.         |\n\n### Flags\n\n| Regex         | API Method                                  | Description                                                            |\n| :------------ | :------------------------------------------ | :--------------------------------------------------------------------- |\n| `g`           | `.global()`                                 | Global iteration. Changes `.exec()` return type to `IterableIterator`. |\n| `i`           | `.ignoreCase()`                             | Case-insensitive match.                                                |\n| `m`           | `.multiline()`                              | Modifies `^` and `$`.                                                  |\n| `s`           | `.dotAll()`                                 | Allows `.` to match newlines.                                          |\n| `d`           | `.withIndices()`                            | Appends `.indices` tuple objects into the `.exec()` return type.       |\n| `v`, `y`, `u` | `.unicodeSets()`, `.sticky()`, `.unicode()` | Other modern ES context flags.                                         |\n\n## Advanced Example: URL Parser\n\nThis example demonstrates how nested captures, alternations, deep optionality, and character classes seamlessly merge into a strictly typed result object. Notice how we compose small regex builders into larger ones.\n\n```typescript\nimport { rx } from \"@fajarnugraha37/ts-rex\";\n\n// Matches 'http' or 'https'\nconst protocol = rx().capture(\n  \"protocol\",\n  rx().literal(\"http\").optional(rx().literal(\"s\")),\n);\n\n// Combine ranges and specific characters safely\nconst alphanumeric = rx()\n  .range(\"a\", \"z\")\n  .or(rx().range(\"A\", \"Z\"))\n  .or(rx().range(\"0\", \"9\"));\n\n// Password allows alphanumeric and special characters\nconst passwordChars = alphanumeric.or(rx().anyOf(\"!@#$%^\u0026*\"));\n\nconst auth = rx().capture(\n  \"auth\",\n  rx()\n    .capture(\"username\", rx().oneOrMore(rx().wordChar()))\n    .literal(\":\")\n    .capture(\"password\", rx().oneOrMore(passwordChars))\n    .literal(\"@\"),\n);\n\n// Domain allows lowercase letters, numbers, dot, and hyphen\nconst domainChars = rx()\n  .range(\"a\", \"z\")\n  .or(rx().range(\"0\", \"9\"))\n  .or(rx().anyOf(\".-\"));\n\nconst urlParser = rx()\n  .startOfInput()\n  .group(protocol)\n  .literal(\"://\")\n  .optional(auth) // Automatically makes auth, username, and password types Partial\n  .capture(\"domain\", rx().oneOrMore(domainChars))\n  .optional(rx().literal(\":\").capture(\"port\", rx().oneOrMore(rx().digit())))\n  .optional(\n    rx().literal(\"/\").capture(\"path\", rx().zeroOrMore(rx().notWhitespace())),\n  )\n  .endOfInput()\n  .compile();\n\nconst parsed = urlParser.exec(\n  \"https://admin:secret123@api.example.com:8080/v1/users\",\n);\n\nif (parsed.isMatch) {\n  // Types are fully mapped based on `.optional()` wrappers!\n  console.log(parsed.protocol); // \"https\" (Type: string)\n  console.log(parsed.domain); // \"api.example.com\" (Type: string)\n\n  // Auth details are typed as string | undefined because of `.optional(auth)`\n  if (parsed.auth) {\n    console.log(parsed.username); // \"admin\"\n    console.log(parsed.password); // \"secret123\"\n  }\n\n  console.log(parsed.port); // \"8080\" (Type: string | undefined)\n  console.log(parsed.path); // \"v1/users\" (Type: string | undefined)\n}\n```\n\n## Structure\n\nThe project relies on interface inheritance and declaration merging across multiple files to maintain a fluent API while keeping files small.\n\n- `/src/core/builder.ts`: Contains the foundational `RegexBuilder` class and compilation logic.\n- `/src/core/types.ts`: Centralized types and the core interface extended by modular syntax files.\n- `/src/syntax/*.ts`: Modular implementation files attaching prototype methods (e.g., `alternation.ts`, `boundaries.ts`, `quantifiers.ts`).\n- `/src/index.ts`: The main entry point.\n- `/tests/*.test.ts`: Categorized behavioral and static type tests.\n\n## Development Workflow\n\n1. Use `bun run test` for running the isolated test suite.\n2. Use `bun run lint` to enforce formatting and style.\n3. Use `bun run build` to output common module formats into the `dist/` directory using `tsup`.\n\n## Testing\n\n### Unit Testing\n\n| Module                            |  % Funcs   |  % Lines  |            Uncovered Line #s            |\n| :-------------------------------- | :--------: | :-------: | :-------------------------------------: |\n| `src/core/builder.ts`             |   100.00   |  100.00   |                                         |\n| `src/index.ts`                    |   100.00   |  100.00   |                                         |\n| `src/syntax/alternation.ts`       |   100.00   |  100.00   |                                         |\n| `src/syntax/boundaries.ts`        |   100.00   |  100.00   |                                         |\n| `src/syntax/character-classes.ts` |   100.00   |  100.00   |                                         |\n| `src/syntax/flags.ts`             |   100.00   |  100.00   |                                         |\n| `src/syntax/groups.ts`            |   100.00   |  100.00   |                                         |\n| `src/syntax/lookarounds.ts`       |   100.00   |  100.00   |                                         |\n| `src/syntax/quantifiers.ts`       |   100.00   |   97.33   | 134 (Lazy quantifier verification hook) |\n| `src/utils/escape.ts`             |   100.00   |  100.00   |                                         |\n| **All files**                     | **100.00** | **99.87** |                                         |\n\n### Performance Baseline: Library vs Native\n\nWe benchmarked the execution path across four complexity levels.\nThe tables below show the execution time and memory allocation per iteration for our current implementation compared to raw native `RegExp`.\n\n#### Results on Bun (v1.3.13)\n\n| Complexity Level          | Library Execution     | Native Raw RegExp Baseline |\n| :------------------------ | :-------------------- | :------------------------- |\n| **Simple** (No captures)  | ~45 ns / ~0 bytes     | ~46 ns / ~0 bytes          |\n| **Medium** (Email parser) | ~650 ns / ~0 bytes    | ~224 ns / ~0 bytes         |\n| **Complex** (URL parser)  | ~511 ns / ~9 bytes    | ~295 ns / ~0 bytes         |\n| **Extremely Complex**     | ~7.58 µs / ~181 bytes | ~0.24 µs / ~1.6 bytes      |\n\n#### Results on Node.js (v24.14.0)\n\n| Complexity Level          | Library Execution    | Native Raw RegExp Baseline |\n| :------------------------ | :------------------- | :------------------------- |\n| **Simple** (No captures)  | ~104 ns / ~129 bytes | ~99 ns / ~128 bytes        |\n| **Medium** (Email parser) | ~355 ns / ~488 bytes | ~220 ns / ~384 bytes       |\n| **Complex** (URL parser)  | ~59 ns / ~80 bytes   | ~297 ns / ~528 bytes       |\n| **Extremely Complex**     | ~391 ns / ~504 bytes | ~246 ns / ~400 bytes       |\n\n_Note: Native execution only returns the raw `RegExpExecArray`. The library returns a strongly-typed object mapping capture groups to properties. Interestingly, on Node.js, V8 heavily optimizes the monomorphic class allocation for the Complex scenario, occasionally resulting in faster execution times than standard raw array mapping._\n\n---\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE). (Semua milik allah - Aldi Taher)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffajarnugraha37%2Fts-rex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffajarnugraha37%2Fts-rex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffajarnugraha37%2Fts-rex/lists"}