Extended search and replace

With the "Extended Search and Replace" tool, you can perform three basic types of operations: search and replace text, convert national characters, and run a spell checker. You can also specify the scope of the operation - from a single document, to an entire site (or even more broadly).

How it works

Search and replace text - allows advanced search and replace text in documents.

Character encoding conversion
Select this option to change the code page used in documents to the one selected from the list. For example, you can change the encoding page from WINDOWS-CP-1250 used exclusively in MS Windows to ISO-8859-2 (the ISO standard used on other platforms).

To read more about character encoding conversion - click here.

Spell check
Select this option to run a spell checker.
To read more about spell check - click here.

How it works - Search and replace text

If Search and replace text is selected the following options can be set:

Normal search
The search text will be the text exactly as entered.

Use wildcards
Search text can contain wildcards that replace the corresponding characters. The following symbols are available:

  • * - replaces any string (also empty)
  • ? - replaces any character
  • # - replaces any digit(from 0 to 9)
  • @ - replaces any letter(a-z, A-Z)
  • $ - replaces any alphanumeric character (digit or letter)
  • ~ - replaces any character that is not an alphanumeric character or a space

Example of using wildcards: to find all opening and closing tags in an HTML document, enter the text <*>.

Note that if you search for a string specified by abc*, the result will be abc followed by any character after it. No further characters will be included in the search result. Thus, if you search for abcdefgh in a string specified by you, only the phrase abcd will be found.

Use regular expressions
Search text may contain regular express ions, described in more detail in a separate topic.

An example of using regular expressions: to find all the opening tags of a header of any degree(<H1> to <H6>) in an HTML document, whether in upper or lower case, enter the text <[hH]\d>.

Case sensitive
Check to make the search text case-sensitive.

Match whole words
Check that the searched phrase must be a whole word, not a fragment of a longer word (e.g. when searching for the phrase 'mar', it will find all the words 'mar', but not 'marek').

Don't show replacement results
Check this option if you do not want a "Results pane" to be shown with a search and replace report after a replacement is performed.

Create backup copies when modifying files

Check this option if you want to create backup copies of the original, unchanged documents when changes are made to documents opened directly from your hard drive (the 'in selected project', 'in folders', or 'in files' options in the Source section). With this option, in case the changes are different from what you intended, you can restore the original documents.

Do not convert when searching
Check to not convert encoding during text search. Checking this option is needed, if in searched documents there is no encoding in HEAD section, but at the same time the encoding is not to be changed (e.g. for files attached to other documents in server-side scripts, e.g. using include in PHP).

Use the second tab,"Search and Replace," to enter texts.

Source

Using the settings in this section of the "Search and replace settings" tab, it is possible to define the scope of the tool - from the currently edited document, to strictly defined types of documents in the selected Project, folders, etc. Depending on the selected scope (data source), options are available:

in the active document - operations will be performed on the document currently open in the editor. There are no additional options.

in all open - operations will be performed on all documents currently open in Spider. There are no additional options.

in the selected project - operations will be performed on all files Project selected from the list (files and folders disabled from view in site settings . You can narrow down file types to:

  • HTML documents - files with extensions specified as "HTML documents" in the "Program settings" window on the "File list" tab
  • files: - This text box allows you to enter file extensions to narrow down the types of documents to be considered. Extensions should be given in the form e.g. *.php;*.php3;*.php4.
  • Skip files / folders when searching and replacing - add files or folders to the list below that should be omitted when searching and replacing in the selected project

in folders - operations will be performed on all files in folders included in the list. The list of folders can be edited using the buttons on the right.

  • Files with extension - this text field allows you to enter file extensions to narrow down the types of documents to be considered. Extensions should be given in the form e.g. *.php;*.php3;*.php4.
  • including all subfolders - check to extend the operation to files from all subfolders in the selected folders
  • Skip files while searching and replacing - add files to the list below that should be excluded from searching and replacing in selected folders

in files - operations will be performed on all files on the list. The file list can be edited using the buttons on the right.

Search and replace

There are two text boxes for entering text:

Find
This field is used to enter the search text. If the corresponding options are checked in the"Search and replace settings" tab, it is possible to use wildcards or regular expressions.

Replace with
Use this field to enter the text to be inserted in place of the found text if "Replace" has been run

The contents of both fields are remembered by the program even after it is closed and reopened.

Search templates
This list contains search templates. By default, the most commonly used ones are available, like the email address template, etc. You can add and remove templates using the buttons to the right of the list:

  • Add current search template - click to create a new search template from the text in the "Find" field.
  • Remove search template - click to remove the selected search template from the list

To make using text replacement easier, you can use the menu above the "Replace with" box:

  • Insert Variable... - click and select the variable you want to use from the menu. After selecting a variable, its symbol will be inserted in the "Convert to" field, which will be converted to the appropriate selected value when the function runs:

    • File name without path: (variable %paj_filename%) inserts the name of the file where the replacement is performed,
    • Name of the file with the path : (the %paj_filefullpath% variable) inserts the access path and the name of the file where the replacement is performed,
    • Path without filename: (variable %paj_filepath%) inserts the path to the file where the replacement is performed,
    • File name with relative path (Web project only): (variable %paj_filerelfullpath%) inserts the path (relative to the project's root directory) and filename of the file in which the replacement is being performed,
    • Relative path of a file in a Web project: (variable %paj_filerelpath%) inserts the path (relative to the root directory of the project) of the file where the replacement is performed,
    • Document modification date and time: ( %paj_filedatetime% variable) inserts the date and time of the last document record where the modification is made (in YYYY-MM-DD HH-MM-SS format),
    • Document Status: (variable %paj_filestatus%) inserts the status of the document in which the conversion is performed (document status can be set in the "Document Information" window)
    • File comment: (variable %paj_filecomment%) inserts a comment for the document in which the replacement is performed (the document comment can be specified in the "Document Information" window)
    • Last file author: (variable %paj_filelastmodifiedby%) inserts the name of the user who last saved the document,
    • Current Date: (variable %paj_date%) inserts the current date (in the format YYYY-MM-DD)
    • Current time: ( %paj_time% variable) inserts the current time (in HH-MM-SS format)
    • Current date and time: ( %paj_datetime% variable) inserts the current date and time (in the format YYYY-MM-DD HH-MM-SS)
  • Enable display of special characters - click to enable or disable the display of special characters, such as the end-of-line character, etc.

  • Enable line wrapping - click to enable or disable line wrapping.

  • Copy the text from the "Find" field to "Replace with" - click to copy the text from the "Find" field to "Replace with". This feature is very useful when there is other text you want on the clipboard.

  • Replace text between "Find" and "Replace with" fields - click to replace the contents of "Find" and "Replace with" fields.

  • Clear text from selected field - click to expand a submenu containing commands to clear the contents of the field 'Find', 'Replace with', or both of these fields.

Related topics

To top