Select Tools | Advanced Find & Replace from the main menu to search for text within the currently open Project TTK or within a folder of Project a files on disk.

Using the options, search for text in source segments, target segments, memo fields or in segment identifiers.

The find and replace engine is a powerful engine that can search not only the text you enter, but also wildcard searches can be performed using regular expression.

note.bmp

The results of Advanced Find & Replace are stored in the Results Toolbar or in a XLIFF based report file. This differs from QuickFind where its results are stored in the Project Workspace pane.

 image44.jpg

Point.bmp

Active object: Select this option if you want to perform your text search on the currently highlighted item in your Project TTK file.

Point.bmp

Current project: Select this option if you want to search the entire contents of your Project TTK file.

Point.bmp

Batch of files: Select this option if you want to search a series of files stored on your local or network drive. When this option is selected you also need to specify the types of files to search and the location of the files.

Point.bmp

Find what: Specify the text you wish to locate. This is referred to as your search criteria. You can type an exact match for the text or fine-tune your search by using regular expressions. If you are looking for an ID select the as an ID checkbox.

Point.bmp

Replace with: Select this option if you’d like to replace found text with an alternative text string.

Point.bmp

Search in translated: Select this option if you want to search only translated fields for text matches.

Point.bmp

Search in original: Select this option if you want to search only original fields for text matches.

Point.bmp

Search in memo: Select this option to perform the search in memo content.

Point.bmp

Search in ID: Select this option to when looking for a segment by ID.  Enter an ID in the 'Find what' field and use this option to search all segment IDs for a complete or partial match.

Point.bmp

Use regular expression: Choose this option when using Regular Expressions to fine-tune your search criteria.

Point.bmp

Include subfolders: Select this option in combination with Batch of Files if you want to recursively search a directory structure for text matches.

Point.bmp

Match case: Select this option if you want your searches case sensitive.

Point.bmp

Ignore hotkey ampersand: Select this option if you want to ignore hotkeys contained within original and translated fields.

Point.bmp

Match whole word only: Select this option restrict searches to complete words.  For example if you wish to search for the word 'can', but don't wish to be returned 'cancel', or 'cannot', opt to match on whole words only.


Regular Expression

See the topic on regular expression for the syntax governing regular expression searching.

Regular Expression Find and Replace

If you use a regular expression pattern to find text, you can then use the 'Replace with:' field to specify what alternative text should go in its place. Using groups in the search pattern will allow pieces of the searched text to be used when replacing.

Consider the example of a currency search and replace.  You may wish to look for a pattern containing two numbers separated by a dot and replace by the same two numbers separated by a comma. E.g. 49.99 should appear as 49,99

This is an easy Find and Replace in CATALYST using regular expression search and replace

To search for the two digit number, use the regular expression [0-9]{2}, which means any digit in range zero to nine appearing twice.

Building on that, we can search for [0-9]{2}\.[0-9]{2}, which means a two digit number, followed by a dot, followed again by a two digit number.

Groups in Regular Expression

To be able to use these matches as text in the replace field, we need to give them a special syntax called groups.  This simply means placing a pair of braces around the match that you wish to use in the replace field.

Adding the braces gives us the final 'Find what:' pattern: ([0-9]{2})\.([0-9]{2}) - it contains two groups.  The piece of text matching the first pattern can be referred to as \1, the resulting text from the second match can be referred to as \2.
 
In these examples, the expression ([0-9]{2})\.([0-9]{2}) matches two digits either side of a dot as follows...

Sample Text

Group Matching using expression ([0-9]{2})\.([0-9]{2})

49.99

\1 = 49,      \2 = 99

$49.99

\1 = 49,      \2 = 99

20.909

\1 = 20,      \2 = 90

€10,509.99

\1 = 09,      \2 = 99

 

Note, the expression used here was created to match two digits either side of the dot.  It could be easily extended to find larger numbers such as the last entry in the table.