Inspectopedia Help

'preg_match()' can be replaced with comparison

Reports the preg_match() calls that are provided with a string argument starting with ^ (Start of String anchor) and ending with $ (End of String anchor). Such calls can be replaced with a comparison operation.

Inspection Details

By default bundled with:

PhpStorm 2024.1, Qodana for PHP 2024.1,

Can be installed with plugin:


Last modified: 12 March 2024