Inspectopedia Help

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.

Example:

[\w\d]

After the quick-fix is applied:

[\w]

Locating this inspection

By ID

Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.

RegExpRedundantClassElement
Via Settings dialog

Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.

Settings or Preferences | Editor | Inspections | RegExp

New in 2022.2

Last modified: 27 August 2024