rspec/rules/S5842/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

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[]