The actions required for this task are:
- Press Ctrl+R to open the replace window.
- Enter the regular expression search string.
- Enter the regular expression replace string.
- Click on gearwheel button to see the advanced replace options if not already displayed.
- Make sure the replace option Regular expressions is checked and the appropriate regular expression engine is selected whereby Perl is the most powerful.
- Make sure the other replace options are set as required for this replace.
- Click on button Replace all.
That's it.
The graphic buttons with
.* above
Find what and
Replace with enabled on having option
Regular expressions checked and appropriate regular expression engine selected help to build the regular expression search and replace strings. Clicking on this button opens a list with regular expression sequences and their meanings and clicking on one item in list inserts the clicked regular expression sequence into search/replace string at current position of caret in search/replace string. The lists contain for legacy
UltraEdit and
Unix regular expression engines really all available special regular expression sequences. The lists contain just most often needed expressions for the most powerful regular expression engine
Perl because of this regular expression engine is so powerful that its full explanation fills entire books or websites. Some of those websites are listed in announcement topic
Readme for the Find/Replace/Regular Expressions forum at top of forum
Find/Replace/Regular Expressions.
For a more detailed help create a new topic in forum
Find/Replace/Regular Expressions with a list of lines before running the replace formatted as
code block and same list of lines as expected after running the replace also formatted as
code block. Select the lines after pasting them into message edit field and click on last but one graphic symbol in toolbar above message edit field from right side showing
>_ to insert the tags around selected lines to format the selected block as
code block.
BTW: Pressing key
F1 opens the help page for the
Replace window if the replace window is floating instead of being docked on left/right side. Double click on title bar of docked replace window to get the
Find and Replace window floating. The help page for
Replace as well as the help pages for
Find,
Find in Files and
Replace in Files contain the links
Regular Expressions and
Perl Regular Expressions explaining completely the legacy regular expression engines
UltraEdit and
Unix and most often used parts of
Perl regular expressions.
On consecutive lines it would be also possible to use column editing mode enabled by pressing
Alt+C, selecting the column to modify with pointing device or keyboard, typing to delete or insert something on selected column(s) in selected lines and finally turn off column editing mode with pressing again
Alt+C. The indicator
COL in status bar at bottom of main application window on right side indicates if column editing mode is currently enabled or disabled.
It would be also possible to use multi-select / multi-caret feature to edit something on multiple lines. Multiple carets can be set by holding left
Ctrl key while setting with a primary (left) mouse button click a new caret into a new line at a specific column. Holding left
Ctrl key while making a selection with primary (left) mouse button adds a new selection to one or more already existing selections. Once multiple carets are set or selections are made, pressing other keys result in updating those selections respectively inserting text at all caret positions.