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

Erik Freitag  Identity Verified
Germany
Local time: 08:22
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]


Direct link Reply with quote
 

Jerzy Czopik  Identity Verified
Germany
Local time: 08:22
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).


Direct link Reply with quote
 

Erik Freitag  Identity Verified
Germany
Local time: 08:22
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


Direct link Reply with quote
 

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

maybe it is possible, but I really do not know

Direct link Reply with quote
 

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

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

Kind regards,
Erik


Direct link Reply with quote
 
FarkasAndras
Local time: 08:22
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.


Direct link Reply with quote
 


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







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 »
BaccS – Business Accounting Software
Modern desktop project management for freelance translators

BaccS makes it easy for translators to manage their projects, schedule tasks, create invoices, and view highly customizable reports. User-friendly, ProZ.com integration, community-driven development – a few reasons BaccS is trusted by translators!

More info »



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