Inspectopedia Help

RegExp

Anonymous capturing group or numeric back reference  

Reports anonymous capturing groups and numeric back references in a RegExp.

Begin or end anchor in unexpected position  

Reports ^ or \A anchors not at the beginning of the pattern and $, \Z or \z anchors not at the end of the pattern.

Consecutive spaces  

Reports multiple consecutive spaces in a RegExp.

Custom RegExp inspection  

Custom Regex Inspection.

Duplicate branch in alternation  

Reports duplicate branches in a RegExp alternation.

Duplicate character in character class  

Reports duplicate characters inside a RegExp character class.

Empty branch in alternation  

Reports empty branches in a RegExp alternation.

Escaped meta character  

Reports escaped meta characters.

Octal escape  

Reports octal escapes, which are easily confused with back references.

Redundant '\d', '[:digit:]', or '\D' class elements  

Reports redundant \d or [:digit:] that are used in one class with \w or [:word:] (\D with \W) and can be removed.

Redundant character escape  

Reports redundant character escape sequences that can be replaced with unescaped characters preserving the meaning.

Redundant nested character class  

Reports unnecessary nested character classes.

Regular expression can be simplified  

Reports regular expressions that can be simplified.

Single character alternation  

Reports single char alternation in a RegExp.

Suspicious back reference  

Reports back references that will not be resolvable at runtime.

Unnecessary non-capturing group  

Reports unnecessary non-capturing groups, which have no influence on the match result.

Last modified: 29 April 2024