Code Inspection: Unnecessary non-capturing group
Configure inspections: Settings | Editor | Inspections
Show intention actions: AltEnter
Reports unnecessary non-capturing groups, which have no influence on the match result.
Example:
Everybody be cool, (?:this) is a robbery!
After the quick-fix is applied:
Everybody be cool, this is a robbery!
New in 2021.1
Place the caret at the highlighted line and press AltEnter or click
.
Click the arrow next to the inspection you want to suppress and select the necessary suppress action.