Need to lock segments with [number][full_stop]
Thread poster: kd42
kd42
kd42
Estonia
Local time: 14:18
English to Russian
Aug 1

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: 12:18
Member (2014)
Japanese to English
Maybe this Aug 2

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: 14:18
Member (2022)
English to Estonian
Solution Aug 2

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: 15:18
English to Russian
Try this Aug 3

^[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: 14:18
English to Russian
TOPIC STARTER
Thanks a lot, the problem is solved Aug 4

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]







TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »
Protemos translation business management system
Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!

The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.

More info »