Download the PHP package liquidrazor/liquid-regex without Composer

On this page you can find all versions of the php package liquidrazor/liquid-regex. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package liquid-regex

LiquidRazor Regex

An intuitive, small, and fast regular expression helper for PHP 8.3+ with clean result objects and a few ergonomic utilities around PCRE.

Package: liquidrazor/liquid-regex β€’ License: MIT


✨ Features


🚧 Requirements


πŸ“¦ Installation

The library is namespaced under LiquidRazor\Regex and PSR‑4 autoloaded per composer.json.


🧠 Concepts at a Glance

Regex β€” main entry point

The Regex class is the main faΓ§ade. It also memoizes compiled instances by pattern:

From there you can match or replace (see examples below).

ResultTypes β€” control your result shape

Choose how match arrays are exposed:

This lets you request exactly the view you need (e.g., only named groups). You can bit‑OR flags:

Flags (PCRE capture flags)

Extra capture behavior forwarded to PCRE:


πŸš€ Quick start

1) Find the first match

3) Replace

LiquidRazor\Regex\Result\Replace\Result implements Stringable. If the replacement result is an array (e.g., when replacing in arrays), __toString() returns JSON.


πŸŽ›οΈ Controlling result shapes

The LiquidRazor\Regex\Result\Matches\Result object exposes a lazy, memoized sequence of match entries. You decide which keys appear using ResultTypes:

The object supports:

If there was no match, the Result is empty with didMatch === false (safe to iterate/count/JSON-encode).


🧩 PCRE helpers

Use the Pcre static utility for environment checks:

Note: isValid() only checks a basic /.../flags shape, also does compile the pattern and checks the result. If compilation fails, it returns false.


⚠️ Exceptions

The library centralizes PCRE errors through LiquidRazor\Regex\Exception classes:

In practice, most API calls either return a Result object or throw on internal PCRE errors (e.g., bad backtrack limit).


πŸ“š API sketch

The following reflects the current source structure at a high level. Some signatures may evolve.

Result types:

Helpers:

Enums / constants:


βœ… Examples

Only named groups, strictly

With offsets and nulls for unmatched


πŸ§ͺ Testing

You can plug this library into any test runner. The result objects are easy to snapshot by JSON encoding.


🀝 Contributing


πŸ“„ License

MIT Β© LiquidRazor


All versions of liquid-regex with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package liquidrazor/liquid-regex contains the following files

Loading the files please wait ...