Short regex code for qa-checker
Thread poster: Lenart

Lenart  Identity Verified
Luxembourg
Local time: 15:18
Apr 11

Hello,

I have this simple code:bi.*bil

But I would like to exclude „bi bil“ from it. Means, I would like to except a text where there is just a single space between the two words.

Does anybody know how to do that?

Thank you!


 

Anthony Rudd

Local time: 15:18
QA regex Apr 11

The regex: "bi bil" (without the quotation marks) matches bi and bil separated with a space (blank);
"bi\sbil" would match bi and bil separated with a whitespace


 

Lenart  Identity Verified
Luxembourg
Local time: 15:18
TOPIC STARTER
I would like to find all „bi.*bil“ that do not include „bi\sbil“ Apr 12

Thank you for your answer!

I would like to use bi.*bil and bi\sbil at the same time.

So I would like to find all „bi.*bil“ that do not include „bi\sbil“.

For example I need a code that would match: „bi z njim bil“ or „bi kljub temu bil“ but does not match „bi bil“.

any ideas how to do that?

[Edited at 2018-04-12 08:15 GMT]


 

Anthony Rudd

Local time: 15:18
QA regex Apr 12

(?!bi bil)bi.*bil
For such situations I have just published a book:
"Practical Usage of Regular Expressions; An introduction to regexes for translators"
that provides many useful examples as well as an easy introduction to regexes, not only for translators.


 

Lenart  Identity Verified
Luxembourg
Local time: 15:18
TOPIC STARTER
test with example Apr 12

Thank you for this look ahead suggestion!

On its basis I am testing this code: (?! bi bil\w?) bi.*bil

I have this example of text: „X naj bi na podlagi sporazuma predložilo predlog za določitev, ki naj bi bil obravnavan na seji.“

The phrase contains first „bi“ and then „bi bil“ and code gives me a match. However, there should be no match, because „bi bil“ should not be matched and „bi“ should also not be matched when standing alone without „bil“ (and not „bi bil“) following later on.

I understand that code finds a match because it takes first „bi“ and then „bil“ (from „bi bil“). But I don't want it to take „bil“ (from „bi bil“), as I want „bi bil“ to be a undivided unite that is ignored completely. Is there a way to integrate that in code?

With other words, if I take a code (?! bi bil\w?) bi.*bil. This very last bil of the code shold not bi part of „bi bil“ in text.

[Edited at 2018-04-12 19:53 GMT]

[Edited at 2018-04-12 19:54 GMT]


 

SDL Community  Identity Verified
United Kingdom
Local time: 15:18
English
Almost... Apr 12

(?!.*bi bil\w?) bi.*bil

 

Lenart  Identity Verified
Luxembourg
Local time: 15:18
TOPIC STARTER
thank you! Apr 16

perfect, thank you!

 


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


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

Short regex code for qa-checker

Advanced search







SDL Trados Studio 2017 only €435 / $519
Get the cheapest prices for SDL Trados Studio 2017 on ProZ.com

Join this translator’s group buy brought to you by ProZ.com and buy SDL Trados Studio 2017 Freelance for only €435 / $519 / £345 / ¥63000 You will also receive FREE access to Studio 2019 when released.

More info »
TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »



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