rspec/rules/S6002/php/rule.adoc

31 lines
506 B
Plaintext
Raw Normal View History

include::../description.adoc[]
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,php]
----
preg_match("/(?=a)b/", $str); // Noncompliant, the same character can't be equal to 'a' and 'b' at the same time
----
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,php]
----
preg_match("/(?<=a)b/", $str);
preg_match("/a(?=b)/", $str);
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../highlighting.adoc[]
endif::env-github,rspecator-view[]