PHPackages                             ldrahnik/regexp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ldrahnik/regexp

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ldrahnik/regexp
===============

Set of regular expressions.

v1.3(11y ago)0452BSD-3-ClausePHPPHP &gt;= 5.4

Since Jan 6Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ldrahnik/regexp)[ Packagist](https://packagist.org/packages/ldrahnik/regexp)[ Docs](https://github.com/ldrahnik/regexp)[ RSS](/packages/ldrahnik-regexp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (7)Used By (0)

ldrahnik/regexp
===============

[](#ldrahnikregexp)

[![Build Status](https://camo.githubusercontent.com/c30a9ab38f1fbdded1ce401f1c06976efc2b93a3cf4b47d5177a06441b2f4c54/68747470733a2f2f7472617669732d63692e6f72672f6c647261686e696b2f7265676578702e737667)](https://travis-ci.org/ldrahnik/regexp)[![Latest stable](https://camo.githubusercontent.com/c44de92e3ecca9f784ae5bb41c20788ac48f5898cff62acee59778b4c6a6761b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c647261686e696b2f7265676578702e737667)](https://packagist.org/packages/ldrahnik/regext)[![Downloads total](https://camo.githubusercontent.com/0547a7f10cf77559311f3c5979f1ce67a949277cf45adbe1796e2105ce5a1e33/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c647261686e696b2f7265676578702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ldrahnik/regexp)

Set of regular expressions.

Requirements
------------

[](#requirements)

ldrahnik/regexp requires PHP 5.4 or higher.

- [Nette Framework](https://github.com/nette/nette)

Installation
------------

[](#installation)

Install regexp to your project using [Composer](http://getcomposer.org/):

```
$ composer require ldrahnik/regexp
```

Usage
-----

[](#usage)

Register extension in config file

```
extensions:
	regexp: regexp\DI\RegexpHelperExtension

regexp:
	myRegularName: ^[0-9]{1,10}$
	twitterUsername: foo
```

Now you can use all regulars through services

```
	/** @var \regexp\Regexp @inject */
	private $regexp;

    public function __construct(regexp\Regexp $regexp)
    {
    	$this->regexp = $regexp;
    }

    public function createComponentForm()
    {
        $form = new Nette\Application\UI\Form();
        $form->addText('twitter', 'Twitter username')
            ->setDefaultValue('@')
            ->addCondition(Form::FILLED)
        	    ->addRule(Form::PATTERN, 'Please enter twitter username, for example: @username',
        	    $this->regexp->getTwitterUsername());
        ...

        //  $this->regexp->getRegularExpression('twitterUsername'));
        //  equivalent of that expression is
        //  $this->regexp->getTwitterUsername();
    }

    ....
```

You are able to use or override already existing embedded regular expressions

```
'username' => '^[a-z0-9_-]{3,16}$',
'twitterUsername' =>  '^(\@)?[A-Za-z0-9_]+$',
'password' => '^[a-z0-9_-]{6,18}$',
'facebook' => '^(https?:\/\/)?(www\.)?facebook.com\/[a-zA-Z0-9(\.\?)?]',
'google' => '((http|https):\/\/)?(www[.])?plus\.google\.com\/.?\/?.?\/?([0-9]*)'
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~24 days

Total

5

Last Release

4050d ago

Major Versions

v0.9 → v1.02015-01-20

PHP version history (2 changes)v1.0PHP &gt;= 5.3.3

v1.1PHP &gt;= 5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/61ee1ce0e850961847ab4c4356bf0506d987f9beaa04da675aa9c27ae873d254?d=identicon)[ldrahnik](/maintainers/ldrahnik)

---

Top Contributors

[![ldrahnik](https://avatars.githubusercontent.com/u/3233644?v=4)](https://github.com/ldrahnik "ldrahnik (1 commits)")

---

Tags

nettepackagephp

### Embed Badge

![Health badge](/badges/ldrahnik-regexp/health.svg)

```
[![Health](https://phpackages.com/badges/ldrahnik-regexp/health.svg)](https://phpackages.com/packages/ldrahnik-regexp)
```

###  Alternatives

[vojtech-dobes/nette-forms-gpspicker

Google Maps based picker of coordinates for Nette Framework.

2456.6k](/packages/vojtech-dobes-nette-forms-gpspicker)[jkuchar/multiplefileupload

Multiple upload form control for Nette framework.

104.4k1](/packages/jkuchar-multiplefileupload)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
