Help to write a Regex to convert strings into into placeholders.
Thread poster: Ben Senior

Ben Senior  Identity Verified
Germany
Local time: 15:56
German to English
Apr 22, 2016

I have several large files which I need to translate, some are word documents (docx) and others are plain text files (txt). In both of these file types there are sequences of characters which must not be changed and I wanted them to be recognised as non-translatable placeholders, but I can't find the correct regex to do it.

The sequence always starts and ends with an angle bracket and in between there is a mixture of numbers and letters, which can be either upper or lower case. Typical strings could look like or .

Any help in putting together a regex and how to insert it into the file type and where would be a great help.

Ben

[Edited at 2016-04-22 17:46 GMT]


 

TechStyle  Identity Verified
United Kingdom
Local time: 14:56
Regexes Apr 22, 2016

Regexes can be handy tools - your examples got eaten by ProZ's forum software, probably too much like HTML. If there can't be spaces, only letters and numbers, then:

(left angle bracket) [a-zA-Z0-9]+ (right angle bracket)

should do what you're after (I've spelled out the two brackets to avoid them getting eaten). Inside the square brackets, you can have a list of acceptable characters; the plus on the end indicates we want one or more of them.


 

Ben Senior  Identity Verified
Germany
Local time: 15:56
German to English
TOPIC STARTER
Missing angle brackets Apr 22, 2016

ProZ ate the angle brackets? Thanks for tip James.
I will try it out tomorrow when I get back on my computer.

Ben


 

Jan Truper
Germany
Local time: 15:56
Member (2016)
English to German
+ ...
Helpful regex website Apr 23, 2016

I found this website to be really useful for all kinds of regex issues:

https://regex101.com


 

Emma Goldsmith  Identity Verified
Spain
Local time: 15:56
Member (2010)
Spanish to English
Other threads Apr 23, 2016

Other threads on this topic will probably give you more clues, in addition to James's suggestion:
http://www.proz.com/forum/sdl_trados_support/301153-regex_to_turn_tags_into_actual_studio_tags.html


 

Ben Senior  Identity Verified
Germany
Local time: 15:56
German to English
TOPIC STARTER
Thank you Apr 23, 2016

Thank you James for the good tip.

@ Jan,
Vielen Dank. A great site, I managed to write three important, for me at least, regular expressions and test them. At least I know that they should work in Studio.

@ Emma,
As ever, thanks for your words of wisdom and your link. Although I have seen that link before it now makes a lot more sense because I know a little about regular expressions.


Next week I will see if I can integrate these regexs into the file types in Studio to create the placeholders.

Regards,

Ben


 


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


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

Help to write a Regex to convert strings into into placeholders.

Advanced search







memoQ translator pro
Kilgray's memoQ is the world's fastest developing integrated localization & translation environment rendering you more productive and efficient.

With our advanced file filters, unlimited language and advanced file support, memoQ translator pro has been designed for translators and reviewers who work on their own, with other translators or in team-based translation projects.

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



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