A small request on a regex rule

I entered a simple rule into Trados Studio 2022:

 Regex target: \s\.

 I was hoping that Trados will show me segments with a space preceding a full stop, yet this rule also matches a Tag preceding a full stop.

Screenshot showing a sentence with a tag '157' placed before a period, underlined with red wavy lines indicating an error.

I have also tried to enter a rule that shows me a match if I mistakenly enter a space after an opening bracket:

 \(\s

 but here again I get a lot of false positives, i.e. a lot of positives with a Tag that show up after the opening bracket. Is there any possibility to exclude those segments with Tags to show up during the check? Does regex regard Tags as spaces?

Thank you for considering my request.



Generated Image Alt-Text
[edited by: RWS Community AI at 10:50 PM (GMT 1) on 23 Jul 2025]
emoji
Parents
  •   

    Probability score: 0.6  

    Question improvement suggestion: Provide specific examples of the segments you are trying to filter out, including any relevant tags, to help clarify your request.  

    In the meantime, based on the information you have provided, here is a suggested answer to your question:  

    Hello!  

    To address your issue with the regex rules in Trados Studio 2022, it seems that the regex patterns you are using are not excluding tags as you intended. Here are some steps you can take to refine your regex rules:

    **Step 1:** Modify your regex for the space before a full stop. Instead of using `\s\.`, you can try using a negative lookbehind to exclude tags. For example, you could use:

    ```

    (?<!<[^>]+)\s\.

    ```

    This pattern checks for a space followed by a full stop, but only if it is not preceded by a tag.

    **Step 2:** For the space after an opening bracket, you can similarly modify your regex to:

    ```

    (?<!<[^>]+)\(\s

    ```

    This will help ensure that you are not matching segments where a tag precedes the opening bracket.

    **Step 3:** Test these modified regex patterns in the Advanced Display Filter to see if they yield the desired results without including segments with tags.

    **Step 4:** If you continue to encounter issues, consider reviewing the segmentation rules in your Translation Memory settings to ensure they are not conflicting with your regex filters.

    By refining your regex patterns, you should be able to filter out the segments with tags effectively. If you have any further questions or need additional assistance, feel free to ask!  

    I hope this answer addressed your question. If not, please reject the answer, add the question improvement suggestion information, and click the RWS Community AI checkbox on the right to try again.  

    RWS Community AI

    emoji
Reply
  •   

    Probability score: 0.6  

    Question improvement suggestion: Provide specific examples of the segments you are trying to filter out, including any relevant tags, to help clarify your request.  

    In the meantime, based on the information you have provided, here is a suggested answer to your question:  

    Hello!  

    To address your issue with the regex rules in Trados Studio 2022, it seems that the regex patterns you are using are not excluding tags as you intended. Here are some steps you can take to refine your regex rules:

    **Step 1:** Modify your regex for the space before a full stop. Instead of using `\s\.`, you can try using a negative lookbehind to exclude tags. For example, you could use:

    ```

    (?<!<[^>]+)\s\.

    ```

    This pattern checks for a space followed by a full stop, but only if it is not preceded by a tag.

    **Step 2:** For the space after an opening bracket, you can similarly modify your regex to:

    ```

    (?<!<[^>]+)\(\s

    ```

    This will help ensure that you are not matching segments where a tag precedes the opening bracket.

    **Step 3:** Test these modified regex patterns in the Advanced Display Filter to see if they yield the desired results without including segments with tags.

    **Step 4:** If you continue to encounter issues, consider reviewing the segmentation rules in your Translation Memory settings to ensure they are not conflicting with your regex filters.

    By refining your regex patterns, you should be able to filter out the segments with tags effectively. If you have any further questions or need additional assistance, feel free to ask!  

    I hope this answer addressed your question. If not, please reject the answer, add the question improvement suggestion information, and click the RWS Community AI checkbox on the right to try again.  

    RWS Community AI

    emoji
Children