DataGrip
 
Get DataGrip

Code Inspection: Single character alternation

Last modified: 13 May 2022

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

Example:

After the quick-fix is applied:

New in 2017.1