Replacing numbers Wordfast Classic

From Wordfast Wiki
Jump to: navigation, search

A segmentation problem had produced segments where match values were often over 100. So the documents had such match values as <}833{> or <}944{> etc. It appeared that the last figure of the match value had been duplicated (these two segments should have been <}83{>.and <}94{>). How could this be fixed in many documents, in one pass, making sure other figures are not modified by the procedure?

The answer is:

Find what (\<\})([1-9])(?)(?)(\{\>)
Replace with \1\2\3\5
Use Wildcards

Explanation: When the "Match wildcards" checkbox is checked, "expressions" are anything contained within parentheses. The "Replace with" numbers actually refers to expressions located in the "Find what" argument.

The ([1-9]) expression in the "Find what" argument, for example, refers to any number in the range 1 - 9. In the "Replace with" argument, it is referred to as \1, meaning, "expression 2".

So the FR action can be read as:

Look for chunks of text made of the following 5 contiguous expressions:

  1. <} followed by
  2. Any number between 1 and 9 followed by
  3. any character followed by
  4. any character followed by
  5. {\>)

If such a chunk of text is found, replace the entire chunk with expressions 1, 2, 3, 5.

As a result, the redundant number (expression 4) is deleted from match values, with no risk of upsetting the rest of the document. An added safety measure could be to set the style for the Search parameter to "tw4winMark".

 Back to Wordfast Classic User Manual