Skip to content

Commit 0f23140

Browse files
committed
docs: improve comment for ArbitraryRegexpPrefix error.
1 parent 2301d4d commit 0f23140

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

lib/src/compiler/errors.rs

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -895,23 +895,22 @@ pub struct IncludeNotAllowed {
895895
include_loc: CodeLoc,
896896
}
897897

898-
/// A regular expression has a prefix that can be arbitrarily long and matches
899-
/// any sequence of bytes.
900-
///
898+
/// Indicates that a regular expression has a prefix that can be arbitrarily
899+
/// long and matches any sequence of bytes.
900+
///
901901
/// # Example
902-
///
903-
/// error[E045]: arbitrary regular expression prefix
904-
/// --> line:3:11
905-
/// |
906-
/// 3 | $a = /.*foo/s
907-
/// | ^^ this prefix can be arbitrarily long and matches all bytes
908-
/// |
909-
///
910-
/// Regular expressions with these kinds of prefixes don't many too much sense,
911-
/// as YARA will report a match at every file offset from the beginning of the
912-
/// file to the offset where the rest of the regular expression matched. In
913-
/// most cases the prefix can be stripped down without changing the rule
914-
/// semantics.
902+
///
903+
/// error[E045]: arbitrary regular expression prefix
904+
/// --> line:3:11
905+
/// |
906+
/// 3 | $a = /.*foo/s
907+
/// | ^^ this prefix can be arbitrarily long and matches all bytes
908+
/// |
909+
///
910+
/// Regular expressions with such prefixes are problematic because YARA will
911+
/// report a match at every file offset from the start of the file up to where
912+
/// the rest of the pattern matches. In most cases, this prefix can be removed
913+
/// without affecting the rule's semantics.
915914
#[derive(ErrorStruct, Clone, Debug, PartialEq, Eq)]
916915
#[associated_enum(CompileError)]
917916
#[error(code = "E045", title = "arbitrary regular expression prefix")]

0 commit comments

Comments
 (0)