Alternative for \\u in regex replacement string
De persoon die dit onderwerp heeft geplaatst: CafeTran Trainer
CafeTran Trainer
CafeTran Trainer
Nederland
Lid 2006
Jan 8

Java (and CafeTran Espresso) doesn't support \u in replacement strings:

\u Changes the case of the next character to the upper case. Use this type of regex in the replace field.


After some thought, I came up with this solution:
First, insert a unique character like "‡" in front of every letter that needs to become uppercase (e.g., in front of every second word in each segment; use a regular expression to do this).
Second, create a text file with replacement rules for each letter of the alphabet.
Third, use this replacement list to run QA > Word lists > Replace in target segments.
1

2

3

4

5



[Edited at 2025-01-08 20:55 GMT]


 
CafeTran Trainer
CafeTran Trainer
Nederland
Lid 2006
ONDERWERPSTARTER
Demo & lists Jan 8

Image-000192

Or: https://share.cleanshot.com/ZYZk8xqR

Image-000187

For \u use:
‡a=A
‡b=B
‡c=C
‡d=D
‡e=E
‡f=F
‡g=G
‡h=H
‡i=I
‡j=J
‡k=K
‡l=L
‡m=M
‡n=N
‡o=O
‡p=P
‡q=Q
‡r=R
‡s=S
‡t=T
‡u=U
‡v=V
‡w=W
‡x=X
‡y=Y
‡z=Z

For \l use:
‡A=a
‡B=b
‡C=c
‡D=d
‡E=e
‡F=f
‡G=g
‡H=h
‡I=i
‡J=j
‡K=k
‡L=l
‡M=m
‡N=n
‡O=o
‡P=p
‡Q=q
‡R=r
‡S=s
‡T=t
‡U=u
‡V=v
‡W=w
‡X=x
‡Y=y
‡Z=z


[Edited at 2025-01-08 21:59 GMT]


 
CafeTran Trainer
CafeTran Trainer
Nederland
Lid 2006
ONDERWERPSTARTER
Important note Jan 9

Please note that the settings in the Find and Replace dialogue box are relevant for the QA Word lists function!

 


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

Moderator(en) van dit forum
Natalie[Call to this topic]

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

Alternative for \\u in regex replacement string






Trados Business Manager Lite
Create customer quotes and invoices from within Trados Studio

Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.

More info »
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 »