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(6y ago)9103[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 2d 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 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity45

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

2530d 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

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[roave/no-floaters

PHPStan Rules to Disallow Float proliferation in contexts where IEEE-754 rounding errors are not acceptable

213314.8k14](/packages/roave-no-floaters)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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