36 lines
359 B
Plaintext
36 lines
359 B
Plaintext
== Why is this an issue?
|
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,php]
|
|
----
|
|
/^a|b|c$/
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,php]
|
|
----
|
|
/^(?:a|b|c)$/
|
|
----
|
|
|
|
or
|
|
|
|
|
|
[source,php]
|
|
----
|
|
/^a$|^b$|^c$/
|
|
----
|
|
|
|
or, if you do want the anchors to only apply to ``++a++`` and ``++c++`` respectively:
|
|
|
|
|
|
[source,php]
|
|
----
|
|
/(?:^a)|b|(?:c$)/
|
|
----
|