1.2.1265. Unkown Regex Options

Regex support in PHP accepts the following list of options : eimsuxADJSUX.

All other letter used as option are not supported : depending on the situation, they may be ignored or raise an error.

<?php

// all options are available
if (preg_match('/\d+/isA', $string, $results)) { }

// p and h are not regex options, p is double
if (preg_match('/\d+/php', $string, $results)) { }

?>

See also Pattern Modifiers.

1.2.1265.1. Suggestions

  • Remove the unknown options

  • Replace the option with a valid one

  • Fix any syntax typo in the regex

1.2.1265.2. Specs

Short name

Structures/UnknownPregOption

Rulesets

All, Analyze, CE

Exakat since

0.8.4

PHP Version

All

Severity

Major

Time To Fix

Slow (1 hour)

Precision

High

Features

regex

Available in

Entreprise Edition, Community Edition, Exakat Cloud