Short regex code for qa-checker
Thread poster: Lenart

Lenart  Identity Verified
Luxembourg
Local time: 04:42
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: 04:42
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: 04:42
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: 04:42
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: 04:42
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: 04:42
English
Almost... Apr 12

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

 

Lenart  Identity Verified
Luxembourg
Local time: 04:42
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







WordFinder Unlimited
For clarity and excellence

WordFinder is the leading dictionary service that gives you the words you want anywhere, anytime. Access 260+ dictionaries from the world's leading dictionary publishers in virtually any device. Find the right word anywhere, anytime - online or offline.

More info »
Déjà Vu X3
Try it, Love it

Find out why Déjà Vu is today the most flexible, customizable and user-friendly tool on the market. See the brand new features in action: *Completely redesigned user interface *Live Preview *Inline spell checking *Inline

More info »



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