errata-ai / vale

:pencil: A markup-aware linter for prose built with speed and extensibility in mind.
https://vale.sh
MIT License
4.52k stars 155 forks source link

Substitution style fails in 3.7.0 #887

Closed jdkato closed 3 months ago

jdkato commented 3 months ago

Discussed in https://github.com/errata-ai/vale/discussions/877

Originally posted by **daobrien** July 25, 2024 We have the following style that works in version 3.6.1: ~~~ --- extends: substitution message: "Use '%s' instead of '%s'." ignorecase: false level: error nonword: true action: name: replace swap: '\b(?:[Ee]\.[Gg]\.)': for example '\b(?:[Ii]\.[Ee]\.)': that is '\b(?:[Ee][Tt][Cc]\.)': and so on '\b(?:[Vv][Ss]\.)': versus '\b(?:[Vv][Ss]\s)(?!Code)': versus ~~~ TL;DR Replace e.g., i.e., etc., with their expansions. One notable exception is the last line, which ignores `VS Code`. But, in 3.7.0, this style does not match against `vs ` and I can't work out why. Did a bug sneak in? Do I need to tweak my regex a bit more (how?). Thanks for any help.