PHPackages                             struggle-for-php/angry-regex - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. struggle-for-php/angry-regex

ActivePhpstan-extension[Validation &amp; Sanitization](/categories/validation)

struggle-for-php/angry-regex
============================

PHPStan Rule to detect Unfavorable Regex

0.0.2(7y ago)9102[1 PRs](https://github.com/struggle-for-php/angry-regex/pulls)MITPHPPHP &gt;=7.2.0CI failing

Since Jun 1Pushed 6y ago2 watchersCompare

[ Source](https://github.com/struggle-for-php/angry-regex)[ Packagist](https://packagist.org/packages/struggle-for-php/angry-regex)[ RSS](/packages/struggle-for-php-angry-regex/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

struggle-for-php/angry-regex
============================

[](#struggle-for-phpangry-regex)

PHPStan Rule to detect Unfavorable Regex.

and add more checking than PHPStan's Regex check.

Based on Tokumaru's statement
-----------------------------

[](#based-on-tokumarus-statement)

- `正規表現によるバリデーションでは ^ と $ ではなく \A と \z を使おう`
    -

Example
-------

[](#example)

```
$ ../vendor/bin/phpstan analyse --level=1 src/
Note: Using configuration file /tmp/angry-regex/demo/phpstan.neon.
 2/2 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ -------------------------------------------------------------
  Line   Demo.php
 ------ -------------------------------------------------------------
  17     Regex pattern is invalid: Unfavorable `^` or `$` /^[0-9]+$/
 ------ -------------------------------------------------------------

 [ERROR] Found 1 error
```

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

[](#installation)

```
composer require --dev struggle-for-php/angry-regex
```

Configuration
-------------

[](#configuration)

In your `phpstan.neon` configuration, add following section:

```
includes:
	- vendor/struggle-for-php/angry-regex/rules.neon
```

Also see.
---------

[](#also-see)

\- Validator\\Ip should not allow newlines in any case. - [zendframework/zendframework#6104](https://github.com/zendframework/zendframework/pull/6104)

###  Health Score

24

—

LowBetter than 30% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~8 days

Total

2

Last Release

2622d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4eed2726ad1fce689a99672d965d8b4a387f030f08290e00708b66e4621139d2?d=identicon)[sasezaki](/maintainers/sasezaki)

---

Top Contributors

[![sasezaki](https://avatars.githubusercontent.com/u/42755?v=4)](https://github.com/sasezaki "sasezaki (8 commits)")[![zonuexe](https://avatars.githubusercontent.com/u/822086?v=4)](https://github.com/zonuexe "zonuexe (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/struggle-for-php-angry-regex/health.svg)

```
[![Health](https://phpackages.com/badges/struggle-for-php-angry-regex/health.svg)](https://phpackages.com/packages/struggle-for-php-angry-regex)
```

###  Alternatives

[rector/rector

Instant Upgrade and Automated Refactoring of any PHP code

10.4k145.3M11.3k](/packages/rector-rector)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.5k60.6M10.3k](/packages/larastan-larastan)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

67475.0M1.5k](/packages/phpstan-phpstan-doctrine)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

79378.2M2.5k](/packages/phpstan-phpstan-symfony)[shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.

5014.2M110](/packages/shipmonk-dead-code-detector)[ssch/typo3-rector

Instant fixes for your TYPO3 PHP code by using Rector.

2613.3M487](/packages/ssch-typo3-rector)

PHPackages © 2026

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