Short regex code for qa-checker
Thread poster: Lenart

Lenart  Identity Verified
Luxembourg
Local time: 08:59
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!


Direct link Reply with quote
 

asr2

Local time: 08:59
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


Direct link Reply with quote
 

Lenart  Identity Verified
Luxembourg
Local time: 08:59
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]


Direct link Reply with quote
 

asr2

Local time: 08:59
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.


Direct link Reply with quote
 

Lenart  Identity Verified
Luxembourg
Local time: 08:59
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]


Direct link Reply with quote
 

SDL Community  Identity Verified
United Kingdom
Local time: 08:59
English
Almost... Apr 12

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

Direct link Reply with quote
 

Lenart  Identity Verified
Luxembourg
Local time: 08:59
TOPIC STARTER
thank you! Apr 16

perfect, thank you!

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 »

Short regex code for qa-checker

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 »
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 »



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