Learn R Programming

lintr (version 3.0.2)

fixed_regex_linter: Require usage of fixed=TRUE in regular expressions where appropriate

Description

Invoking a regular expression engine is overkill for cases when the search pattern only involves static patterns.

Usage

fixed_regex_linter()

Arguments

Tags

best_practices, efficiency, readability

Details

NB: for stringr functions, that means wrapping the pattern in stringr::fixed().

NB: This linter is likely not able to distinguish every possible case when a fixed regular expression is preferable, rather it seeks to identify likely cases. It should never report false positives, however; please report false positives as an error.

See Also

linters for a complete list of linters available in lintr.