When I first started adding articles about how to use regular expressions I thought I’d only write three… but I had an interesting question from one of our resellers, Agenor (actually Agenor always asks me the hardest questions!), about how to use the display filter to find segments that contain one word, but not another. It was tricky, but once you have it you can use the expression all the time. I have a collection of such things from when people ask me, so I thought I’d share how this problem was solved and also post a list of some of the useful regular expressions I have saved for the display filter in Studio 2011.
The final article (in this introductory series anyway) on regular expressions in Studio is looking at how to use search and replace in Studio. This capability, to use regex to replace as well as search, will only be possible with the update release of SDL Trados Studio 2011 SP2 and later and it’s a very welcome addition to the toolset provided within Studio.
In Regular Expressions – Part 1 I wrote a summary of where regular expressions could be used in SDL Trados Studio, and I covered a couple of examples. I also referred to RegexBuddy quite a lot as this is a really useful tool in helping you write and understand regular expressions. But in case learning another application is something you don’t want to do I thought it would be handy to go through what I think are the most useful applications of regular expressions for every day use in SDL Trados Studio, and also share a few tips on how to use Studio to verify the expressions are finding what you need as well as introduce a little “economy of accuracy“.
Regular Expressions, often referred to as Regex, are something that come up again and again in forums, roadshows and the occasional questions. So I thought it might be useful to take a better look at them and how they can be useful for translators. To begin with I’m republishing a blog article I wrote a year or so ago on a different site so I can build on this theme in one location.