Finding text using regular expressions
You can use regular expressions when finding and replacing text in the Editor view and Translation Memories view.
About this task
You can use regular expressions in your search criteria. For example, you could search segments that contain email addresses in the text. Regular expressions are used to search text for all occurrences of a particular sequence, or pattern, of characters. They differ from standard search tools because they use special metacharacters. Metacharacters enable you to create a single regular expression that will find all occurrences of a basic pattern and also specific variations of the pattern.
This tool is for users who know how to create and use regular expressions.
Trados Studio uses the .Net syntax for regular expressions. For more information on how to use regular expressions, see http://www.regular-expressions.info/reference.html.
Procedure
- Go to the Projects view and select the project you want to work on.
- Go to the Files view and double-click the file you want to work on.
- Go to the Home tab > Editing group > Find.
- Select Use Regular Expressions and make your changes.
Example: text search using regular expressions
You could use this feature to change the order of words in a sentence across all occurrences of that sentence.
Use this regular expression in the Find box:
- field '(\w+)'
It finds matching sentences in the document where XYZ represents the field name:
- "The field 'XYZ' is displayed."
For example, it might find the following sentences:
- "The field Address is displayed."
- "The field Name is displayed."
- "The field Email is displayed."