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
  •   

    There is a way you can achieve this with the advanced display filter.  So if you start with this sample:

    Screenshot showing five segments with the text 'In order to start click on this button.' and highlighted numbers 33, 38, 51, and 64 in purple.

    In order to filter on segments with a space preceding a full stop you could do this:

    (?<=\s)\.

    As Jerzy mentioned this won't work because segment #4 should not be picked up and it is:

    Screenshot showing three segments with the text 'In order to start click on this button.' and highlighted numbers 51 and 64 in purple.

    But if you use the Advanced Display Filter to search in tag content then it will be able to recognise something is there:

    So now you get this:

    Screenshot showing two segments with the text 'In order to start click on this button.' and highlighted number 64 in purple.

    And this is probably what you want.

    You can use a similar logic for your bracket.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji


    Generated Image Alt-Text
    [edited by: RWS Community AI at 9:06 AM (GMT 1) on 24 Jul 2025]
Reply Children