RegexDashEscapeRector

Escape - in some cases

-preg_match("#[\w-()]#", 'some text');
+preg_match("#[\w\-()]#", 'some text');

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\Php73\Rector\FuncCall\RegexDashEscapeRector;

return RectorConfig::configure()
    ->withRules([
        RegexDashEscapeRector::class,
    ]);
SETS:  PHP 7.3