We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
LINE_PATTERN
1 parent 34afe66 commit 8a8df06Copy full SHA for 8a8df06
src/tools/jsondocck/src/main.rs
@@ -16,12 +16,15 @@ use directive::{Directive, DirectiveKind};
16
static LINE_PATTERN: LazyLock<Regex> = LazyLock::new(|| {
17
RegexBuilder::new(
18
r"
19
- ^\s*
20
- //@\s+
21
- (?P<negated>!?)
22
- (?P<directive>[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)
23
- (?P<args>.*)$
24
- ",
+ # Any number of whitespaces.
+ \s*
+ # The directive prefix (`//@`) and 1 or more whitespaces after.
+ //@\s+
+ # The directive itself (1 or more word or `-` characters).
+ (?P<directive>[\w-]+)
25
+ # The optional remainder (1 non-word character and 0 or more of any characters after).
26
+ (?P<args>\W.*)?
27
+ ",
28
)
29
.ignore_whitespace(true)
30
.build()
0 commit comments