1.2.603. Invalid Regex¶
The PCRE regex doesn’t compile. It isn’t a valid regex.
Several reasons may lead to this situation : syntax error, Unknown modifier, missing parenthesis or reference.
Regex are check with the Exakat version of PHP.
Dynamic regex are only checked for simple values. Dynamic values may eventually generate a compilation error.
<?php
// valid regex
preg_match('/[abc]/', $string);
// invalid regex (missing terminating ] for character class
preg_match('/[abc/', $string);
?>
1.2.603.1. Suggestions¶
Fix the regex before running it
1.2.603.2. Specs¶
Short name |
Structures/InvalidRegex |
Rulesets |
|
Exakat since |
1.0.5 |
PHP Version |
All |
Severity |
Major |
Time To Fix |
Quick (30 mins) |
Precision |
High |
Examples |
|
Available in |