Regular Expressions for Translators - Introduction Thread poster: Shouguang Cao
|
In this series of articles, I will try to write a tutorial that makes sense to us, not to coding monkeys What is Regular expression We all use search and replace feature. Regular expressions are simply using wild cards to search and/or replace. I suppose you know how to replace “cat” with “dog”, but if you want to replace all three-letter words ending with “at” like “hat”, “mat”... See more In this series of articles, I will try to write a tutorial that makes sense to us, not to coding monkeys What is Regular expression We all use search and replace feature. Regular expressions are simply using wild cards to search and/or replace. I suppose you know how to replace “cat” with “dog”, but if you want to replace all three-letter words ending with “at” like “hat”, “mat”, “rat” with “dog”, you will need the wild card. With regular expressions, you can search for something that is not exact but follows certain patterns. For example, search for a 8 digit telephone number. How can it be useful to translators When you are frustrated by repetitive work, there is likely a simpler, automatic solution with regular expressions. Before I explain, let’s do an experiment just to admire the miracle. First all use this link to download “notepad++”. https://notepad-plus-plus.org/download/v7.4.2.html Now launch notepad++, copy/paste the text into a blank text file in notepad++. I love this game.:Me encanta este juego. I love regular expressions.:Me encantan las expresiones regulares. Regular expressions are amazing.:Las expresiones regulares son asombrosas. They do wonderful things.:Hacen cosas maravillosas. (Spanish translation provided by Google Translate)
Use “CTRL+H” to open the search/replace dialog, and tick “Regular Expressions” under search mode section. Press CTRL+HOME to put your cursor at the beginning of the file. Task one: You want to delete all the English source text. (Search for “.*:” and leave Replace With empty) Task two: Or you want to delete all the Spanish text. (Search for “:.*” and leave Replace With empty) Task three: Or you want to switch the position of “source:target” to “target:source”. (Search for “(.*):(.*)” and replace with “\2:\1” Isn’t this amazing? In this tutorial we will always learn by experiment, so please keep your notepad++ open! Regular expressions can be complicated, but it's really easy to know the basics and and start using them. I have translation work to do right now, and will continue to write next week. Let me know if you are interested! And have confidence in yourself and in me. I once wrote a guide to linux iptables for dummies and people say it's easy and clear ! http://dallascao.com/cn/iptables-tutorial-for-newbies/ (in Chinese though, but look the replies. They are all real.)
[Edited at 2017-07-21 15:18 GMT] ▲ Collapse | | |
I don't understand why I would search for "regular expressions" in the course of translating. | | |
Shouguang Cao wrote: Now launch notepad++, copy/paste the text into a blank text file in notepad++. I love this game.:Me encanta este juego. I love regular expressions.:Me encantan las expresiones regulares. Regular expressions are amazing.:Las expresiones regulares son asombrosas. They do wonderful things.:Hacen cosas maravillosas. (Spanish translation provided by Google Translate) Use “CTRL+H” to open the search/replace dialog, and tick “Regular Expressions” under search mode section. Press CTRL+HOME to put your cursor at the beginning of the file. Task one: You want to delete all the English source text. (Search for “.*:” and leave Replace With empty) Task two: Or you want to delete all the Spanish text. (Search for “:.*” and leave Replace With empty) Task three: Or you want to switch the position of “source:target” to “target:source”. (Search for “(.*):(.*)” and replace with “\2:\1” I rarely apply the Regular Expression function. But I promote extensive use of it to enhance our productivity. I am going to be 65 years old. This is why I need to move proactively. Dr. Soonthon Lupkitaro Bangkok, Thailand | | | Shouguang Cao China Local time: 14:32 English to Chinese + ... TOPIC STARTER not difficult after all | Jul 23, 2017 |
With just a little practise of the basic syntax, everyone can use regular expressions to do something. Soonthon LUPKITARO(Ph.D.) wrote: Shouguang Cao wrote: Now launch notepad++, copy/paste the text into a blank text file in notepad++. I love this game.:Me encanta este juego. I love regular expressions.:Me encantan las expresiones regulares. Regular expressions are amazing.:Las expresiones regulares son asombrosas. They do wonderful things.:Hacen cosas maravillosas. (Spanish translation provided by Google Translate) Use “CTRL+H” to open the search/replace dialog, and tick “Regular Expressions” under search mode section. Press CTRL+HOME to put your cursor at the beginning of the file. Task one: You want to delete all the English source text. (Search for “.*:” and leave Replace With empty) Task two: Or you want to delete all the Spanish text. (Search for “:.*” and leave Replace With empty) Task three: Or you want to switch the position of “source:target” to “target:source”. (Search for “(.*):(.*)” and replace with “\2:\1” I rarely apply the Regular Expression function. But I promote extensive use of it to enhance our productivity. I am going to be 65 years old. This is why I need to move proactively. Dr. Soonthon Lupkitaro Bangkok, Thailand | | | To report site rules violations or get help, contact a site moderator: You can also contact site staff by submitting a support request » Regular Expressions for Translators - Introduction Wordfast Pro | Translation Memory Software for Any Platform
Exclusive discount for ProZ.com users!
Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value
Buy now! » |
| Anycount & Translation Office 3000 | Translation Office 3000
Translation Office 3000 is an advanced accounting tool for freelance translators and small agencies. TO3000 easily and seamlessly integrates with the business life of professional freelance translators.
More info » |
|
| | | | X Sign in to your ProZ.com account... | | | | | |