Need to lock segments with [number][full_stop]
Thread poster: kd42
kd42
kd42
Estonia
Local time: 06:57
English to Russian
Aug 1, 2024

Good day,

Is there a way to lock all segments which contain only a number followed by a full stop?
Like
1.
5.
67.
666.
I tried Cleanup Source where I used [0-9][\.] and regex, but it locks the segments containing the number with a full stop along with other data, and the flag "Whole" is not selectable with "regex".
Am I doing something wrong?

Are there other methods?

Is this post going to be approved in 2027?
... See more
Good day,

Is there a way to lock all segments which contain only a number followed by a full stop?
Like
1.
5.
67.
666.
I tried Cleanup Source where I used [0-9][\.] and regex, but it locks the segments containing the number with a full stop along with other data, and the flag "Whole" is not selectable with "regex".
Am I doing something wrong?

Are there other methods?

Is this post going to be approved in 2027?

Thank you.

[Edited at 2024-08-01 19:38 GMT]
Collapse


 
Dan Lucas
Dan Lucas  Identity Verified
United Kingdom
Local time: 04:57
Member (2014)
Japanese to English
Maybe this Aug 2, 2024

kd42 wrote:
I tried Cleanup Source where I used [0-9][\.]

I always test carefully using the filter (with regular expressions enabled) in Trados itself before using Cleanup Source with a new regex. I haven't looked at this closely but maybe "[0-9]?\." or "^[0-9]?\.$" would work for you. Obviously quotation marks should not be included.

Dan


kd42
expressisverbis
 
Andrus Lauringson
Andrus Lauringson  Identity Verified
Estonia
Local time: 06:57
Member (2022)
English to Estonian
Solution Aug 2, 2024

1. From the main menu bar, select tab "View" - "Advanced Display filter 2.0"

2. In "Advanced Display Filter" window: select tab "Content", in field "Source", write:
^\d+\.$

3. Mark check box "Regular Expression"

4. Click "Apply Filter"

5. Click on the little square above the first segment:
click


6. Press Ctrl + L (or right click and select "Lock segments")

[Edited at 2024-08-02 08:26 GMT]


kd42
expressisverbis
 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 07:57
English to Russian
Try this Aug 3, 2024

^[0-9]+\.$

Explanation:
Your regex won't work because brackets are used for ranges or specific characters included in between them.
[0-9] captures single numbers from 0 to 9 only: 0, 1, ... 9, but not 13, 66 or 311.
[\.] captures either a slash or any character because the slash character doesn't work to escape the period when used between brackets. Unless escaped, the period char means any char. In other words, syntax like \. stands for the period character only,
... See more
^[0-9]+\.$

Explanation:
Your regex won't work because brackets are used for ranges or specific characters included in between them.
[0-9] captures single numbers from 0 to 9 only: 0, 1, ... 9, but not 13, 66 or 311.
[\.] captures either a slash or any character because the slash character doesn't work to escape the period when used between brackets. Unless escaped, the period char means any char. In other words, syntax like \. stands for the period character only, while syntax like [\.] stands for \ (slash) or . (any character).
Characters ^ and $ mean the beginning and the end of a string. You need these characters too to instruct that you only need the strings entirely consisting of a number followed by a period. If you don't use those characters, it can also capture a number with a period among other characters or words.
Also you need to use a quantifier + that means 1 or more instances of the preciding value (range from 0 to 9 in your case). This would capture numbers like 13., 661., etc.

***This one is not exactly what you are asking for, but still you can try it too: ^[\d\W]*$
It can capture numbers with non-alphabet characters.

[Edited at 2024-08-04 04:13 GMT]
Collapse


kd42
expressisverbis
Andrus Lauringson
 
kd42
kd42
Estonia
Local time: 06:57
English to Russian
TOPIC STARTER
Thanks a lot, the problem is solved Aug 4, 2024

Dear Dan, Andrus, and Stepan.
Thanks a lot for coming to help and for the advice, both general and related to my specific task.
It is so nice to see that such competent colleagues generously share their knowledge with those in need.
:^)


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

Need to lock segments with [number][full_stop]







Pastey
Your smart companion app

Pastey is an innovative desktop application that bridges the gap between human expertise and artificial intelligence. With intuitive keyboard shortcuts, Pastey transforms your source text into AI-powered draft translations.

Find out more »
Trados Studio 2022 Freelance
The leading translation software used by over 270,000 translators.

Designed with your feedback in mind, Trados Studio 2022 delivers an unrivalled, powerful desktop and cloud solution, empowering you to work in the most efficient and cost-effective way.

More info »