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