Replace using Wildcards or Regular Expressions in Trados Studio 2017 SR1

What "expression pair using wildcards" should I use in "Find What" and "Replace With" in order to replace dot (.) with comma (,) on several number sequences in Trados Studio 2017 SR1?

For example, a "Chemical_Project.docx.sdlxlif" file has the description of several organic compound syntheses and several different 1H NMR number data, such as, for example, 1H NMR (400 MHz, CDCl3): δ 8.38 (d, J = 4.6 Hz, 1H), 8.00 (dd, J = 8.8, 5.5 Hz, 2H), 7.44 (d, J = 4.6 Hz, 1H), 7.09 (t, J = 8.8 Hz, 2H), 4.41 – 4.14 (m, 4H), 4.05 – 3.75 (m, 4H), 1.37 (s, 9H).

Such different 1H NMR number data is shown on several Source Segments that should be copied to the respective Target Segments, and each dot (.) (only in numbers) should be replaced with a comma (,). The above 1H NMR number data, for example, should be "translated" as " RMN de 1H (400 MHz, CDCl3): δ 8,38 (d, J = 4,6 Hz, 1H), 8,00 (dd, J = 8,8, 5,5 Hz, 2H), 7,44 (d, J = 4,6 Hz, 1H), 7,09 (t, J = 8,8 Hz, 2H), 4,41 – 4,14 (m, 4H), 4,05 – 3,75 (m, 4H), 1,37 (s, 9H)."

In Microsoft Word 2010, the replacement of dot (.) with comma (,) (in several number sequences, as shown above) is done very quickly using:

FIND What: ([0-9]).([0-9])

REPLACE With: \1,\2

Use wildcards


Unfortunately I did not find yet an expression pair similar to ([0-9]).([0-9]) and \1,\2 (using wildcards) that works in Trados Studio 2017 SR1.

Would be possible to use a Regular Expression instead of wildcards? If possible, what regular expression should be used?

Thank you very much for your kind attention.

Best regards,

Renato Colonna Rosman

Parents Reply Children
  • Dear Paul Filkin

    Your suggestion (regular expression) works perfectly!

    For example on the Target Segment containing " 1H NMR (500 MHz, CDCl3) d 8.04 (s, 1H), 7.69-7.58 (m, 2H), 7.40 (d, J = 4.5 Hz, 1H), 7.35 (d, J = 4.5 Hz, 1H), 7.25 (s, 2H), 7.03 (dd, J = 7.8, 0.6 Hz, 1H), 6.97 (t, J = 8.7 Hz, 2H), 4.39 (t, J = 4.9 Hz, 2H), 4.06 (t, J = 4.9 Hz, 2H), 3.62 (s, 2H), 3.56 (s, 2H), 1.58 (s, 6H).", each dot (.) in each number (and inside parentheses) is replaced with a comma (,) using your regular expression, and the Target Segment is modified to:  "1H NMR (500 MHz, CDCl3) d 8,04 (s, 1H), 7,69-7,58 (m, 2H), 7,40 (d, J = 4,5 Hz, 1H), 7,35 (d, J = 4,5 Hz, 1H), 7,25 (s, 2H), 7,03 (dd, J = 7,8, 0,6 Hz, 1H), 6,97 (t, J = 8,7 Hz, 2H), 4,39 (t, J = 4,9 Hz, 2H), 4,06 (t, J = 4,9 Hz, 2H), 3,62 (s, 2H), 3,56 (s, 2H), 1,58 (s, 6H)".

    Thank you very much for your kind attention and suggestion!

    Best regards,

    Renato Colonna Rosman

  • Dear Paul Filkin

    Your suggestion (regular expression) works perfectly!

    For example, on the Selected Target Segment containing " 1H NMR (500 MHz, CDCl3) d 8.04 (s, 1H), 7.69-7.58 (m, 2H), 7.40 (d, J = 4.5 Hz, 1H), 7.35 (d, J = 4.5 Hz, 1H), 7.25 (s, 2H), 7.03 (dd, J = 7.8, 0.6 Hz, 1H), 6.97 (t, J = 8.7 Hz, 2H), 4.39 (t, J = 4.9 Hz, 2H), 4.06 (t, J = 4.9 Hz, 2H), 3.62 (s, 2H), 3.56 (s, 2H), 1.58 (s, 6H).", each dot (.) in each number (and inside parentheses) is replaced with a comma (,) using your regular expression, and the Selected Target Segment is modified to:  "1H NMR (500 MHz, CDCl3) d 8,04 (s, 1H), 7,69-7,58 (m, 2H), 7,40 (d, J = 4,5 Hz, 1H), 7,35 (d, J = 4,5 Hz, 1H), 7,25 (s, 2H), 7,03 (dd, J = 7,8, 0,6 Hz, 1H), 6,97 (t, J = 8,7 Hz, 2H), 4,39 (t, J = 4,9 Hz, 2H), 4,06 (t, J = 4,9 Hz, 2H), 3,62 (s, 2H), 3,56 (s, 2H), 1,58 (s, 6H)".

    Thank you very much for your kind attention and suggestion!

    Best regards,

    Renato Colonna Rosman