[Passolo] How Do I Replace a String Using Regular Replace Expression
Thread poster: Exotic Hadron

Exotic Hadron
Russian Federation
May 22, 2013

Hello there,

Does anybody of you by chance know how do we use regular expressions in replace string in Passolo?
We need to a find an apostrophe in an Unicode alpha-numeric string and add an extra backslash before the apostrophe (this is necessary to escape the apostrophe symbol for that text).

The source string would be: TecтTest’ TestТест
Goal: TecтTest\’ TestТест
Obviously, the find expression should look like a combination of three classes:
([\p{L} \p{Nd}])(\’)([\p{L} \p{Nd}])
([\p{L} \p{Nd}]) — 1st and 3rd class of characters that includes all alphanumeric characters.
(\’) — the 2nd class that includes an apostrophe character only.

So that the replacement expression would be: $1\$2$3
where $n is nth class of characters.

Running a search’n'replace procedure in a special tool would give us: TecтTest\’ TestТест

So here goes the issue with Passolo. In Passolo it is NOT supported (to my knowledge) to use regular expressions in replace string. The application searches for the string using regular expression and replaces in with a flat sequence of characters.
If we used Passolo, for a given example we’d get:
TecтTes$1\$2$3 estТест

What it does, it cuts off by 1 neighboring characters next to the apostrophe and replaces the sequence with $1\$2$3!

Indeed instead of interpreting the replacement string Passolo treats it just as a text. What a behavior!

Any clue on fixing that? How would it be possible to do such a replacement in Passolo without scripting?

Thank you.

Direct link Reply with quote

Achim Herrmann
Local time: 08:48
English to German
Some answers and additional tips May 23, 2013

I was not able to reproduce your problem. Maybe there are some differences in what apostrophe is in your text and expression and what is displayed in the web site of the blog. SDL Passolo IS supporting back references in the replace expression. I did a simple test replacing


and it works without problems as expected without inserting any unexpected literal text from the expression into the translation.

Maybe you can simplify your expression so that is only exchanges the apostrophe. Another solution depends on the file format. If you are localizing text files you can simply avoid the problem by inserting a mapping into the parser rule that automatically exchanges ' with \' when the target file is generated.

Achim Herrmann
SDL Passolo Business Consultant

Direct link Reply with quote

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

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

[Passolo] How Do I Replace a String Using Regular Replace Expression

Advanced search

PerfectIt consistency checker
Faster Checking, Greater Accuracy

PerfectIt helps deliver error-free documents. It improves consistency, ensures quality and helps to enforce style guides. It’s a powerful tool for pro users, and comes with the assurance of a 30-day money back guarantee.

More info »
WordFinder Unlimited
For clarity and excellence

WordFinder is the leading dictionary service that gives you the words you want anywhere, anytime. Access 260+ dictionaries from the world's leading dictionary publishers in virtually any device. Find the right word anywhere, anytime - online or offline.

More info »

  • All of ProZ.com
  • Term search
  • Jobs
  • Forums
  • Multiple search