Skip to content

Incorrect behavior of SimplifyRegexPatternRector #7993

@kenjis

Description

@kenjis

Bug Report

Subject Details
Rector version last dev-main
Installed as composer dependency

Minimal PHP Code Causing Issue

See https://getrector.com/demo/0b4c127c-4159-4c99-93ac-92d6f97e5945

<?php

final class DemoFile
{
    public function run()
    {
        echo '[0-9] and \d are a bit different.';
    }
}
@@ -4,6 +4,6 @@
 {
     public function run()
     {
-        echo '[0-9] and \d are a bit different.';
+        echo '\d and \d are a bit different.';
     }
 }

Responsible rules

  • SimplifyRegexPatternRector

Expected Behavior

No change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions