QA Checker > Regular Expressions

Use the QA Checker 3.0 > Regular Expressions settings to specify regular expressions to use in order to find particular string patterns in the document. All regular expressions in the list are applied to the translation document. Create the expression and then add them to the list.

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. However, a list of example regular expressions is provided and non-expert users can simply add these.

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.

These settings appear in multiple dialog boxes in SDL Trados Studio. Click here for more information about finding the appropriate dialog box.

 

Setting

Setting Description

Search regular expressions

Select this so you can specify regular expressions to use in order to find particular string patterns in the document. All regular expressions in the list are applied to the translation document.

 

Next to this check on the right-hand side is a drop-down list with three options:  Error, Warning and Note. Select the severity you want to apply if this check finds errors.

Description

Enter a description for the regular expression you have created. This is used for identification when reporting on the verified document.

RegEx source

Enter a regular expression you have created to search the source segments.

RegEx target

Enter a regular expression you have created to search the target segments.

Condition

If you want to apply a restriction to the regular expression search, select one of the following conditions:

  • Report if both target and source RegEx patterns match: An error is only reported if the pattern is found in the source and target segment.

  • Report if target matches but not the source: An error is only reported if the pattern is found in just the target segment and not the source segment.

  • Report if source matches but not the target: An error is only reported if the pattern is found in just the source segment and not the target segment.

  • Report if source matches (source check only): Only the source segments are checked for the pattern and not the target segments. An error is reported if the pattern is found in the source segment.

  • Report if target matches (target check only): Only the target segments are checked for the pattern and not the source segments. An error is reported if the pattern is found in the target segment.

  • Report if both source and target match but with different count: An error is only reported if the number of patterns found in the source and target segments is different.

  • Grouped search expression – report if source matches but not target: This uses backreferences from the groups specified in the source RegEx to construct a string in the target expression to search the target segments. If the target does not contain the correct string it is reported.

For example, look at the following two segments. The QA Checker will find p. 45 in the source segment and will use the 45 as a backreference in the target expression to construct a string which will search the target segment for S. 45. A warning will be reported for the target segment because it contains S. 46, instead of S.45.

Source Segment:  See more details on p. 45 of our book.
Target Segment:  Für mehr Details, sehen Sie auf S. 46 unseres Buchs nach.

NOTE

The target RegEx cannot contain any special escape characters and will act exactly as pattern for replace function of .NET RegEx implementation.

  • Grouped search expression – report if source and target matches: This uses backreferences from the groups specified in the source RegEx to construct a string in the target expression to search the target segments. If it finds a matching string in the target segment but with a forbidden variant, it is reported.

For example, look at the following two segments. The QA Checker will find 1.2 in the source segment and will use the 1.2 as a backreference in the target expression to construct a string which will search the target segment. In this example it has found a matching target segment but is reported because there is a forbidden variant of the match from the source. 1-2 is a forbidden variant.

Source Segment:  This is my 1.2 testing sentence.

Target Segment:  Toto je moje 1-2 testovaci veta.

NOTE

In this case, target RegEx cannot contain any special escape character and will act exactly as pattern for replace function of .NET RegEx implementation

For information about backreferences, see http://www.regular-expressions.info/brackets.html.

Ignore case

Select this if you want to ignore case when matching patterns in the source and target segments.

Action

Click this to display the Action drop-down menu where you can perform the following commands:

  • Add Item: When you have completed the Description, RegEx source, RegEx target and Condition boxes, click this to add the regular expression to the list.

  • Update Item: Select a regular expression in the list to display details for it in the Description, RegEx source, RegEx target and Condition boxes. Make any necessary changes and click this to update the regular expression in the list.

  • Remove Item: Select a regular expression in the list and click this to remove it.

  • Clear Items: Click this to remove all regular expressions from the list.

  • Examples: Click this and select an example to display details for it in the Description, RegEx source, RegEx target and Condition boxes. You can then add the example to your list by clicking Add Item.

 

 

Related Topics

Overview:  Verifying Translations

Verification

QA Checker

      We welcome your comments about the documentation. Click here to send us an email: techcomms@sdl.com.

Topic:  Published: 27-Jun-2012