
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.
51 lines
599 B
Plaintext
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[]
|