Regex search and replace inspections
You can use regular expressions to create your own search and replace inspections. These inspections can be especially useful to highlight style-based or formatting-based problems.
Access regex inspections
Press Ctrl+Alt+S to open the IDE settings and then select
.From the options on the right, click .
Select Add RegExp Search Inspection from the list and you’ll be directed to a dialog where you can set up your new inspection.
Select the language, use hints on the left to build a regexp, and designate the required replacement for the selected pieces of code. You can also configure the way you want the IDE to highlight them in the project.
In the editor, press Alt+Enter to invoke the inspection.
Last modified: 11 February 2024