The search / replace pattern dialog is a powerful tool that can search for standard regular expressions and replace them even with backreferences, new lines and tabs.

 

icon_exclaim Regular expression can be unexpected sometimes. Note also that a pattern is applied to the entire file, not just line by line. So if you are replacing and do not have the option "open in editor" enabled, we recommend backing up the affected files first.

 

icon_idea Read about what you can do at Examples.

 

Find box

Enter here a standard regular expression to search for.

 

Case sensitive

Whether the case of the pattern to find will matter while matching

 

Ungreedy

[from perlre.pod]

By default a quantified subpattern is "greedy", that is, it will match as many times as possible (given a particular starting location) while still allowing the rest of the pattern to match. If you want it to match the minimum number of times possible, select this option. Note that the meanings don't change, just the "greediness".

 

Replace box

Enter here text to replace with.

 

  • Backreferences are noted with \1, \2 ... \9 etc.
  • New line is \n
  • Tab character is \t

 

Prompt on replace

If you have enabled replace, then you will be prompted for each replacement.

 

Open files in editor; Don't save

If you have deselected Prompt on replace, then the files replaced will not be saved, but opened in the editor for further review or canceling changes.

 

Detect & keep EOL

An important option that should be enabled at all times. If you want to search for new lines (\n) then depending on the file searched, the search pattern would have to be different. For example

 

  • Files with window style line endings would require \r\n
  • Files with UNIX style line endings would need \n
  • Files with Mac style line endings would need \r

 

If you would where also replacing then you would also need the according pattern in the replace box.

 

However if you have this option enabled, then you do not have to worry about the EOL characters in the file you happen to be searching. In both the Find and Replace box, "\n" means end of line.

 

 

File mask box

 

The file mask box is shown only when the Pattern find dialog invoked to search in a project of files in File Explorer, and can limit the files to search using wildcards. Note that you cannot select specific files from a project to search on, only limit the files search using a wildcard. If you want to search in specific files in a project, then open the File Explorer and select the files you want.

 

Recursive search

If you have selected folders in the File explorer, then selecting this options will search in subfolders also of the folder.

 

Search in binary files

When selected then files that are binary will be searched also for the regular expression you entered. For example, try searching in all *.exe files in your windows folder for e-mails. The results will be shown in the code explorer that can handle display of binary files.

 

 

 

Top  Previous  Next