DataGrip
 
Get DataGrip

Structural search and replace

Last modified: 08 October 2024

A conventional search process does not take into account the syntax and semantics of the source code. Even if you use regular expressions, DataGrip still treats your code as a regular text. The structural search and replace (SSR) actions let you search for a particular code pattern or grammatical construct in your code considering your code structure.

DataGrip finds and replaces fragments of source code, based on the search templates that you create and conditions you apply.

When you run a structural search, you look for values that might be represented by a search template. If the search template matches a part of source code, the expression that fits the user-defined template is highlighted. A search template is a search query that consists of text, variables, filters, scopes, and context. With all these tools, you can narrow the scope of your search and get more accurate results.