Vale uses the regexp2 library to process regular expressions in its
rules. This library extends the capabilities of the standard Go regexp package by supporting features like lookaheads, lookbehinds, and
lazy quantifiers, which are missing in Go’s built-in regexp implementation.
This guide provides an overview of regex syntax supported by Vale, along with
tips for writing regular expressions in YAML files.
Vale Studio provides a rule editor that integrates with regex101 to
allow you to inspect the compiled regex pattern and test it against sample
text. This can be a helpful way to debug your regex patterns.
For markup-based rules, Vale converts each document to HTML and applies a scoping system before running any rules.
This means that if you’re writing a rule that targets markup syntax or needs to
match across block boundaries, the results may be different from what you
expect.
If you like to apply a rule to the entire, unprocessed document, you can use scope: raw:
yaml
Copy
extends: existencemessage: Consider removing '%s'scope: rawtokens: - some token