Need to lock segments with [number][full_stop]
Αποστολέας σε συζήτηση: kd42
kd42
kd42
Εσθονία
Local time: 10:35
Αγγλικά σε Ρωσικά
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
Ηνωμένο Βασίλειο
Local time: 08:35
Μέλος από 2014
Ιαπωνικά σε Αγγλικά
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
Εσθονία
Local time: 10:35
Μέλος από 2022
Αγγλικά σε Εσθονικά
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
Ρωσία
Local time: 11:35
Αγγλικά σε Ρωσικά
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
Εσθονία
Local time: 10:35
Αγγλικά σε Ρωσικά
ΞΕΚΙΝΗΣΕ ΤΟ ΘΕΜΑ
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]







CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

Buy now! »
Anycount & Translation Office 3000
Translation Office 3000

Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.

More info »