Oh, there are much better ones. Both Marek Pawelec and Anthony Rudd have done very nice syntax handouts you can find in various places. Anthony's is in the Files section of the Facebook memoQ Users group. I'm not sure where or if Marek has posted his anywhere; he just gave me a copy last January in some classes we taught together in Lisbon.
For my personal use, I just add stuff (useful syntax I never remember) to my Regex Assistant library with the tag "cheat sheet", then I export expressions with that keyword and do XSLT on the export to make a pretty HTML page of it all. The subject of a future post, actually, and shown several times in public lectures on regex library management.
Generally speaking, for technically-minded translators I actually do recommend that they learn at least the basics of regex, so that they may build a short library of useful expressions, such as
^((?!string).)*$
which allows searching for a string that is not there (useful in filters, when you can filter for a certain expression in the source and only those segment that do not contain a certain translation the target).
For myself, whenever I discover or create a new useful search string, I write it down in a repository, together with an explanation, so that I may reuse it in the future.
Good practice on your part. I won't tell you how often I've had to explain to translators that they need to replace stuff like "string" in your expression with the text they actually care about! Trying to teach regex syntax to someone like that is probably a lost cause. A cookbook list with short instructions will do.
The whole notion that most of these people will become effective on any reasonable time scale at developing their own expression libraries, with everyone pretty much solving the same problems over and over is ludicrous. Better to buy one of Anthony's books and copy/paste a lot, do a quick Google search or ask someone like you or me. Consider, for example, the time examples in the post I released a few minutes ago (https://memoquickies.substack.com/p/on-time-filtering-find-and-replace). Ask your average "expert" for some expressions to do that stuff, and you'll still go through quite a few iterations before you're able to clean up many messes I've seen. That's why I deliberately left "false starts" in the narrative, because that's how things usually go. What chance does the average wordworker have of mastering and applying considerations like the ones discussed there? Very little. Most will become discouraged and then not even dare to apply canned, idiot-proofed solutions that you give them.
Then there's that one person in 100 who will come back and show you how you *really* ought to have done things. They're what I stick around for :-)
Thank you for the Expresso tip. I was thinking to do a review of Regex Buddy here but that may be a better choice. I look forward to having a good look.
Your cheat sheet is almost all we need. I would only add two of the most important ones:
"^": segment start; and
"$": segment end
Oh, there are much better ones. Both Marek Pawelec and Anthony Rudd have done very nice syntax handouts you can find in various places. Anthony's is in the Files section of the Facebook memoQ Users group. I'm not sure where or if Marek has posted his anywhere; he just gave me a copy last January in some classes we taught together in Lisbon.
For my personal use, I just add stuff (useful syntax I never remember) to my Regex Assistant library with the tag "cheat sheet", then I export expressions with that keyword and do XSLT on the export to make a pretty HTML page of it all. The subject of a future post, actually, and shown several times in public lectures on regex library management.
Hi Kevin,
When I present on regex, I have a simpler definition of regex than yours I call it "Search (and Replace) on Steroids" (see my presentations here: https://www.aboutranslation.com/p/regular-expressions.html).
Also, for memoQ and Trados users, I recommend Expresso, a free regex tool (similar to Regex Buddy): https://ultrapico.com/expresso.htm
Generally speaking, for technically-minded translators I actually do recommend that they learn at least the basics of regex, so that they may build a short library of useful expressions, such as
^((?!string).)*$
which allows searching for a string that is not there (useful in filters, when you can filter for a certain expression in the source and only those segment that do not contain a certain translation the target).
For myself, whenever I discover or create a new useful search string, I write it down in a repository, together with an explanation, so that I may reuse it in the future.
Riccardo
Good practice on your part. I won't tell you how often I've had to explain to translators that they need to replace stuff like "string" in your expression with the text they actually care about! Trying to teach regex syntax to someone like that is probably a lost cause. A cookbook list with short instructions will do.
The whole notion that most of these people will become effective on any reasonable time scale at developing their own expression libraries, with everyone pretty much solving the same problems over and over is ludicrous. Better to buy one of Anthony's books and copy/paste a lot, do a quick Google search or ask someone like you or me. Consider, for example, the time examples in the post I released a few minutes ago (https://memoquickies.substack.com/p/on-time-filtering-find-and-replace). Ask your average "expert" for some expressions to do that stuff, and you'll still go through quite a few iterations before you're able to clean up many messes I've seen. That's why I deliberately left "false starts" in the narrative, because that's how things usually go. What chance does the average wordworker have of mastering and applying considerations like the ones discussed there? Very little. Most will become discouraged and then not even dare to apply canned, idiot-proofed solutions that you give them.
Then there's that one person in 100 who will come back and show you how you *really* ought to have done things. They're what I stick around for :-)
Thank you for the Expresso tip. I was thinking to do a review of Regex Buddy here but that may be a better choice. I look forward to having a good look.
Regex Buddy is better than Expresso... especially if one works with different flavors of regex (Expresso only does .NET).
On the other hand, Expresso is good, and free, and both memoQ and Trados use .NET regex, so Expresso works well for those CAT tools.
I tend to use Expresso most of the time, and Regex Buddy only when I have to work with POSIX or other flavors of regex.