Searching/Replacing Text
The topology view provides a local search/replace function with which you can find/replace text in the view and its subeditors. The search finds all elements that contain the search string in their station/system name, IP/Mac address, type name, comment, etc. Also observe the project-global FIND AND REPLACE function located in the Cross Function Area.
The following views/subeditors are included in the search:
- Topology view
- Unconnected devices
- Online snapshots
- VLAN configuration
Note
Only editable strings such as comments can be replaced. A corresponding alert appears when you try to replace non-editable text. |
Find and replace text as follows:
- Open the search/replace bar by pressing <Ctrl> + <F> (the 'Find what' field gets the focus), <Ctrl> + <H> (the 'Replace with' field gets the focus), or click the
button on the worksheet's toolbar. The bar appears below the worksheet's toolbar.
- Enter the text to be found into the 'Find what' field or select a previous search string from the drop-down list in the input field.
- Optionally, click the option button
on the search bar and activate the desired find options. You can use wildcards or regular expressions. Refer to the section below.
Note
Incorrect 'Find options' may lead to an invalid search result. Make sure that the checked options are suitable for the entered search string. |
- Click the 'Continue search' button
or press <Enter> to jump to the first found occurrence of the search string.To search forward, click the 'Continue search' button or press <F3>. To search backward, press <Shift> + <F3>.
- To replace found text, enter the desired string into the 'Replace with' field.
- Click 'Replace'
(shortcut <Alt> + <R>) to replace only the occurrence selected in the result list.
- Click 'Replace All'
(shortcut <Alt> + <A>) to replace all occurrences of the found string, independently of the selection in the worksheet.
Note
When closing the search bar, the entered search string is retained. Pressing <F3> in the current worksheet finds the next occurrence of the search string and <Shift> + <F3> the previous occurrence. The search string is deleted when you close the worksheet. |
Find options
The find options are displayed by clicking the
button on the search bar.
The following options act as filters if checked. The button is highlighted with a yellow border if a find option is activated.
Find option | Description |
Find backward | If activated, the search string is searched (and replaced) backward inside the editor from the current cursor position/selected object in the editor to the top of the editor. In case the top of the editor is reached, the search will automatically restart from the end of the editor. |
Match Case | If activated, the search is done case-sensitive: only text matching upper and lower cases of the entered search string is found. |
Match whole word | The found text has to match with the whole search text. Like 'Match Case', this option is also useful to limit the number of found text occurrences. |
Use wildcards | The use of the wildcards '*' and '?' is allowed in the search text:
? represents a single character in the search string, * represents one or more characters in the search string.The wildcards can be combined in the search string. |
Use regular expressions | Regular expressions allow more complex text searches by entering particular search patterns, i.e., search strings that follow a defined syntax. The most relevant expressions are listed below. |
Regular expressions
As PLCnext Engineer is based on .NET, thus using the Regular Expression Language, more regular expressions are available than these listed here. The table, however, only lists expressions useful in practice of PLCnext Engineer.
Note
The expressions shown below can be combined. |
Expression | Description | Examples |
* | Quantifier: matches the previous element zero, one or more times. | 'Find what': \d*.5
Found: 1.5, 999.5, .5 |
+ | Quantifier: matches the previous element one or more times. | 'Find what': o+
('Match Case' unchecked)Found: OO in BOOL and o in PLCMODE_ON (variable name) |
| | Alternation, i.e., logical OR combination of search terms: matches any one term separated by the | character. | 'Find what': In(Var|Signal)
Found: InVar and InSignal |
[first-last] | Character range: matches any single character in the range from first to last. | 'Find what': [A-C]
Found: A and C in ACDC1974
'Find what': [1-5]
Found: 1 and 4 in ACDC1974 |
[c1..c2..c3] | Character selection: matches each single character specified within brackets, separated by "..".
| 'Find what': [1..4..7]
Found: 1 and 4 and 7 in ACDC1974 |
\d | Character selection: matches any decimal digit. | 'Find what': \d
Found:Text worksheet: 0 and 1 in C001
Graphical worksheet: literal containing a decimal number as well as CTD_1 instance name.
 |
\s | Character selection: matches any white space. | 'Find what': \s
Found:Graphical worksheet: spaces in comments
 |
^ | Position anchor: the match must start at the beginning of the string or line. | 'Find what': ^CTD
Found: Text worksheet: CTD_1 in CTD_1 : CTD;
Graphical worksheet: instance name and FB name, standing alone Variables table: type in instance declaration
 |
$ | Position anchor: the match must start at the end of the string or line. | 'Find what': TON$
Found: Graphical worksheet: instance name, standing alone, and TON at the end of the comment string. |
Toolbar and keyboard shortcuts for local text search/replace
Find and replace text as follows: