
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.
40 lines
770 B
Plaintext
40 lines
770 B
Plaintext
include::description.adoc[]
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,text]
|
|
----
|
|
"(?:)*" // same as the empty regex, the '*' accomplishes nothing
|
|
"(?:|x)*" // same as the empty regex, the alternative has no effect
|
|
"(?:x|)*" // same as 'x*', the empty alternative has no effect
|
|
"(?:x*|y*)*" // same as 'x*', the first alternative would always match, y* is never tried
|
|
"(?:x?)*" // same as 'x*'
|
|
"(?:x?)+" // same as 'x*'
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,text]
|
|
----
|
|
"x*"
|
|
----
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Remove this part of the regex.
|
|
|
|
|
|
=== Highlighting
|
|
|
|
the part of the regex responsible of making it matching the empty String
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|