rspec/rules/S5850/rule-jvm.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

51 lines
599 B
Plaintext

include::description.adoc[]
=== Noncompliant code example
[source,text]
----
^a|b|c$
----
=== Compliant solution
[source,text]
----
^(?:a|b|c)$
----
or
[source,text]
----
^a$|^b$|^c$
----
or, if you do want the anchors to only apply to ``++a++`` and ``++c++`` respectively:
[source,text]
----
(?:^a)|b|(?:c$)
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Group parts of the regex together to make the intended operator precedence explicit.
=== Highlighting
The entire regex
endif::env-github,rspecator-view[]