Migrate composer/pcre to TypeScript

C Runtime-assisted · version 3.4.0

composer/pcre 3.4.0 is a PHP package released under the MIT license and requires PHP ^7.4 || ^8.0. Pext migrates it to TypeScript; on Node.js, 79 of 105 PHPUnit tests pass (75.2%), with 26 failures and no errors. It has no tracked dependencies, and 4 tracked packages depend on it.

PCRE wrapping library that offers type-safe preg_* replacements.

ConvertsYes
Runs on Node.jsYes
Runs on BunNot yet measured
TypeScript typesNot emitted

PHPUnit results on Node.js

75.2% of 105 tests passing (79 passed, 26 failed, 0 errors, 0 skipped). Verified 2026-10-21.

Where tests fail

The 5 test classes with the most failing tests on Node.js:

Test classFailing tests
MatchTest6
MatchAllTest4
ReplaceCallbackTest4
IsMatchTest2
ReplaceCallbackArrayTest2

The remaining 8 failing tests are spread across other classes.

What “Runtime-assisted” means

Runs and passes most of its tests, with the Pext runtime doing visible work to preserve PHP behaviour.

Requirements

PHP
^7.4 || ^8.0
Extensions
None declared

As declared in the package's Composer metadata. Pext provides PHP extensions through its runtime modules.

Dependencies

No tracked dependencies.

Used by

More from composer

Upstream

Version
3.4.0
License
MIT
Keywords
pcre, regex, preg, regular expression

Migrating a codebase that uses composer/pcre?

See how Pext migrates a real PHP application, its Composer dependencies and its test suite to TypeScript.