AnyLogic
Expand
Font size

Searching text strings

AnyLogic allows searching for text in the workbench (the search results will be displayed in the Search view).

To search the text

  1. Open the Search dialog box by clicking the Search toolbar button.

    The Search dialog box

  2. In the Containing Text box, type the string you want to search for. From the drop-down menu, you can choose to repeat or modify a recent search. When you type, you can use wildcards shown in the dialog:
    • * matches any set of characters, including an empty string.
    • ? matches any character.
    • \ is the escape character. If you want to search for an asterisk, question mark, or backslash character, type a backslash before it to indicate that you are not using these characters as wildcards (for example, \*, \?, or \\)
  3. Enable the Case Sensitive if you want the text search to be case sensitive.
  4. Enable the Regular Expression option to define a pattern that restricts the set of allowed strings, thereby limiting the possible values. When writing a pattern, follow the standard syntax for regular expressions: see the Java Pattern class documentation for details.
  5. Select the scope of your search using the Scope radio buttons. You can either search the entire workspace (Workspace option) or only the currently selected model element (Selection option). If you choose to search through the selection, the search is performed through all branches of the workspace subtree starting from the selection point.
  6. Click Search to finish. The search results are displayed in the Search view.
  7. If you want to replace the search results with something else, click the Replace button and in the Replace window you'll be offered to enter the value that will replace the search results.

Search View

This view displays the results of a text search.

Here is what the Search view looks like:

The Search view

To show/hide the Search view

  1. Choose View > Search from the main menu.

Search results are displayed as branches of your workspace tree leading down to the model elements containing string matching search expression. For example, your search can output that the looked for text is found in some property of a model element. You can simply proceed to this particular property by double-clicking it in the search tree. The element with the text string matching the search expression will be selected in the workspace tree, and the string will be highlighted in the Properties view opened for this element.

Icon Command Description
Show Next Match This command highlights the next match in the workspace.
Show Previous Match This command highlights the previous match in the workspace.
Expand All Expand all matches in the hierarchical view.
Collapse All Collapse all matches in the hierarchical view.
Run the Current Search Again Run the search with the current settings again.
Show Previous Searches This command allows you to browse previously conducted searches and repeat a previous search. You can select a previous search from the drop-down menu or clear the search history.
How can we improve this article?
Send Feedback