Inspectopedia 2024.3 Help

Single character alternation

Reports single char alternation in a RegExp. It is simpler to use a character class instead. This may also provide better matching performance.

Example:

a|b|c|d

After the quick-fix is applied:

[abcd]

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.

RegExpSingleCharAlternation
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 2017.1

Last modified: 03 December 2024