rspec/rules/S5869/php/rule.adoc

22 lines
403 B
Plaintext

== Why is this an issue?
include::../description.adoc[]
=== Noncompliant code example
[source,php]
----
"/[0-99]/" // Noncompliant, this won't actually match strings with two digits
"/[0-9.-_]/" // Noncompliant, .-_ is a range that already contains 0-9 (as well as various other characters such as capital letters)
----
=== Compliant solution
[source,php]
----
"/[0-9]{1,2}/"
"/[0-9.\\-_]/"
----