Download the PHP package iak/regexbuilder without Composer

On this page you can find all versions of the php package iak/regexbuilder. 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 regexbuilder

Regex builder

A fluent api that simplifies writing regular expressions. (for the ones of us who always forget the syntax)

Installation

Grab it using composer

Simple as that :)

Introduction

This library is for all of us that find regular expressions hard to write and impossible to remember all the different flags, look aheads, capture groups etc.

Instead of spending that half hour searching stackoverflow, I hope you can easily whip up a pattern using this lib.

Note. a basic understading of how regular expressions is still needed.

Quick start

First of all, use the class at the top of you file,

Now you can use it like this

Or maybe something more advanced (and demostrating some different ways of using the library)

Documentation

Words, patterns and symbols


word(mixed $word = null)

Matches provided word, array of words or any word


notWord()

Matches anything but a word


symbols(string $symbols)

Matches provided symbols (escapes string, if you don't want that, use "pattern")


pattern(string $pattern)

Matches provided pattern
Aliases: raw()


Characters


You can match a bunch of characters using the following helper methods


Quantifiers


oneOrMore()

Matches one or more of preceding group, character or character set.


zeroOrMore()

Matches zero or more


count(int $count/$start, int $end = null)

Matches the specified amount or the minimum and maximun count


Groups & Character sets


range(mixed $start, $mixed $end)

Specifies a range, made especially for working with character sets


group(mixed $pattern/$callback)

Creates a character set


Capture groups


capture(callable $callback = null)

Creates a capture group


opionalCapture(mixed $pattern/$callback)

Creates a non capturing group


startCapture() and endCapture()

You can also surround what you want to capture with these methods


Look aheads & look behinds


behind(mixed $pattern/$callback)

Creates a look behind
Aliases: beginsWith(), before()


after(mixed $pattern/$callback)

Creates a look ahead, works exactly like before()
Aliases: endsWith()


Other helpers


optional(mixed $characters/$start = null, $length = null)

Makes capture group, character set or character optional


escape(string $pattern)

Escapes provided pattern


getPattern()

Returs the built up pattern


release()

Removes built up pattern


Matching and replacing


replace($string, $subject)

Replace built up pattern with provided string


match($string)

Matches the first occurrence of the built up pattern
Note! only return the match. If you want all capture groups, use matchWithGroups()


matchAll($string)

Matches all of the occurences of the built up pattern
Note! only return the match. If you want all capture groups, use matchAllWithGroups()


All versions of regexbuilder with dependencies

PHP Build Version
Package Version
No informations.
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 iak/regexbuilder contains the following files

Loading the files please wait ....