# Search templates, modifiers, and script constraints

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/ruby/2026.3/llms.txt).

When you construct a template for a structural search you are basically writing a script. To simplify your scripting process, RubyMine offers you a list of predefined search templates that you can use as prototypes for your search template.

![the Existing Templates dialog](https://resources.jetbrains.com/help/img/idea/2026.3/ws_existing_templates.png)

On how to access the list of the existing search and replace templates, see the [structural search and replace](structural-search-and-replace.html) section.

A valid search or replacement template represents one of the following supported languages constructs:

* Expression, for example `"John" + " " + "Doe"`

* Statement, or sequence of statements, for example `document.getElementById("demo").innerHTML = "Hello Dolly.";`

* Class designator, for example `class Engine implements IEngine`

* Line or block comments, for example `/** Created in RubyMine */`.

In search templates, the following simplifications can be used:

* Method body can be omitted.

* Short class names (instead of fully qualified names) are used in the templates and constraint fields.

* Using `class $Class$` as a template results in finding anonymous classes as well.

* Templates for comments and documentation comments should contain variables and constructs with correct comment and JSDoc syntax.

Each search or replace template consists of variables `$variable_name$` to which you can add a condition (modifier) to narrow your search results. Modifiers depend on a variable in your search template.

## See also

### Procedures

[Structural search and replace](structural-search-and-replace.html)

### Tutorials and Examples

