Studio: How to prevent segment filter from parsing search term as regular expression?
Thread poster: Erik Freitag

Erik Freitag  Identity Verified
Germany
Local time: 01:10
Member (2006)
Dutch to German
+ ...
Sep 18, 2011

Dear colleagues,

In Studio 2009, I was trying to filter the target segments that contain the string "i.e.". However, the filter function seems to interpret the search string as a regular expression, which I don't want here.

As I'm not very familiar with regex, I'd appreciate your help:

1. How can I prevent the segment filter from parsing the search term as a regex?
2. If that's not possible: What would a regex to find all segments containing the string "i.e." or "i. e." look like?

Many thanks in advance,
kind regards,
Erik



[Bearbeitet am 2011-09-18 11:20 GMT]


 

Jerzy Czopik  Identity Verified
Germany
Local time: 01:10
Member (2003)
Polish to German
+ ...
Dot is an element of regex Sep 18, 2011

So you have to "escape" the dot, if you want to look for a dot and not for character category, represented by the dot.
It is quite easy to remember: if something does not bring the result you expect, try to "escape" it.

The regex for "i. e." is "i\. e\."
The \ character means "escape", that is the character which follows after \ will be searched as is and not with its regex meaning (at least in the easiest explanation, it is in fact not that easy).


 

Erik Freitag  Identity Verified
Germany
Local time: 01:10
Member (2006)
Dutch to German
+ ...
TOPIC STARTER
Thanks Sep 18, 2011

Dear Jerzy,

Many thanks for your explanation. Allow me one further question: Is there a simple way of defining a whole string as non-regex, then?

Kind regards,
Erik


 

Jerzy Czopik  Identity Verified
Germany
Local time: 01:10
Member (2003)
Polish to German
+ ...
Maybe... Sep 18, 2011

maybe it is possible, but I really do not know

 

Erik Freitag  Identity Verified
Germany
Local time: 01:10
Member (2006)
Dutch to German
+ ...
TOPIC STARTER
Thanks! Sep 18, 2011

Thanks, Jerzy! Your hint has helped me a lot!

Kind regards,
Erik


 

FarkasAndras
Local time: 01:10
English to Hungarian
+ ...
No Sep 19, 2011

efreitag wrote:

Is there a simple way of defining a whole string as non-regex, then?


Apparently, no. Normally, it would be \Q...\E, which forces the regex engine to read everything between \Q and \E literally. However, this is not supported by the .NET regex engine, which Stuio uses. Apparently, .NET doesn't have any such feature so you have to escape (meta)characters one by one with \.
In the Find and Replace box, you can just disable regular expressions altogether, but in the Filter box, you can't.


 


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


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

Studio: How to prevent segment filter from parsing search term as regular expression?

Advanced search







CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use SDL Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

More info »
Protemos translation business management system
Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!

The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.

More info »



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