mirror of
https://github.com/github/codeql.git
synced 2026-05-15 11:49:28 +02:00
22 lines
588 B
Plaintext
22 lines
588 B
Plaintext
/**
|
|
* @name Backspace escape in regular expression
|
|
* @description Using '\b' to escape the backspace character in a regular expression is confusing
|
|
* since it could be mistaken for a word boundary assertion.
|
|
* @kind problem
|
|
* @problem.severity recommendation
|
|
* @id js/regex/backspace-escape
|
|
* @tags quality
|
|
* maintainability
|
|
* readability
|
|
* correctness
|
|
* @precision medium
|
|
*/
|
|
|
|
import javascript
|
|
|
|
from RegExpCharEscape rece
|
|
where
|
|
rece.toString() = "\\b" and
|
|
rece.isPartOfRegExpLiteral()
|
|
select rece, "Backspace escape in regular expression."
|