Regex/QA Checker 3.0 > If (word1) and (word2) are both in the sentance Thread poster: Lenart
| Lenart Luxembourg Local time: 01:47
I would like QA checker to show an error every time apples and bananas are in the same segment. I thought this code in Regex target should do the work: (?=apples)(?=bananas) but it doesn't can somebody please explain me where is the error or propose a different code for the same goal? also, is there some sort of list of regex expressions for QA checker? thank you, L | | | Eirik Birkeland Norway Local time: 01:47 English to Norwegian (Bokmal) + ... Lookaheads, etc. | Jun 14, 2017 |
(?=apples) is an example of a lookahead. This type of pattern is useful in some cases, but is often not essential. I suggest trying the following: apples.*bananas|bananas.*apples This will match apples, followed by anything, followed by bananas OR bananas, following by anything, followed by apples It's not a very elegant expression, but you can check a demo he... See more (?=apples) is an example of a lookahead. This type of pattern is useful in some cases, but is often not essential. I suggest trying the following: apples.*bananas|bananas.*apples This will match apples, followed by anything, followed by bananas OR bananas, following by anything, followed by apples It's not a very elegant expression, but you can check a demo here: https://regex101.com/r/kqBCzb/1 It seems to me that the program you are using supports standard PCRE (Perl-compliant regular expressions), and if that is actually the case I highly recommend http://www.regular-expressions.info/ as a concise and powerful resource for regular expressions. ▲ Collapse | | | Lenart Luxembourg Local time: 01:47 TOPIC STARTER Thank you Erik, | Jun 15, 2017 |
that was very helpful! | | | Lenart Luxembourg Local time: 01:47 TOPIC STARTER if source start with («) and target start with anything different then („) | Jun 15, 2017 |
if you can help me out with one more, I would appreciate it if source start with («) and target starts with anything different then („), send me an error. So i would need a code for Regex Source: if segment starts with («) and a code for Regex Target: if segment starts with anything else then („) | |
|
|
The regex flavor used by Studio is .NET | Jun 15, 2017 |
Eirik Birkeland wrote: It seems to me that the program you are using supports standard PCRE (Perl-compliant regular expressions), and if that is actually the case I highly recommend http://www.regular-expressions.info/ as a concise and powerful resource for regular expressions. Actually, I believe that the regex flavor used by Studio is .NET. A useful free tool to build and check .NET regular expressions is Expresso An expression you can use could be (apple|banana).*(banana|apple) | | | Regex for quotes at the start | Jun 15, 2017 |
Lenart wrote: if you can help me out with one more, I would appreciate it if source start with («) and target starts with anything different then („), send me an error. So i would need a code for Regex Source: if segment starts with («) and a code for Regex Target: if segment starts with anything else then („) regex for source: ^« regex for target: ^[^„] In fact for the source you can also make it more universal, e.g.: ^[«"“] This would cover any segment that starts with a French, straight or curly double quotes | | | | Lenart Luxembourg Local time: 01:47 TOPIC STARTER
for codes and bunch of very useful information | |
|
|
Lenart Luxembourg Local time: 01:47 TOPIC STARTER count of an specific word in source and target | Jun 20, 2017 |
I have another related question end would appreciate any help. Here's the issue: Word "apple" appears 3 times in source sentence. It corresponds to a word "pomme" which also appears 3 times in target. I would like to check if number of repetition of the word apple is the same as number of repetition of word pomme. in Verification/qa checker 3.0/Regular expressions I insert this: Regex source:apple Regex target:pomme and I cho... See more I have another related question end would appreciate any help. Here's the issue: Word "apple" appears 3 times in source sentence. It corresponds to a word "pomme" which also appears 3 times in target. I would like to check if number of repetition of the word apple is the same as number of repetition of word pomme. in Verification/qa checker 3.0/Regular expressions I insert this: Regex source:apple Regex target:pomme and I choose the condition: Report if warning source and target match but with different count I run the check and don't get any warnings as I have 3 times apple in source and 3 times pommes in target However, if I use the same condition and change regex target slightly (Regex target:pomm.*ver.*), I get an warning that a segment includes 3 times apple, but only one time pomm.*ver.* (even though the word pomme vert actually repeats 3 times in target). Does anybody have an explanation why? It seems as though regex stops counting once it finds a word witch ends with.* Is there any way to avoid this? or is there any other way to check if number of repetition of the word apple is the same as number of repetition of word „pomm.*ver.*“? Thank you
[Edited at 2017-06-20 13:29 GMT]
[Edited at 2017-06-20 13:38 GMT]
[Edited at 2017-06-20 13:46 GMT]
[Edited at 2017-06-21 07:02 GMT] ▲ Collapse | | | To report site rules violations or get help, contact a site moderator: You can also contact site staff by submitting a support request » Regex/QA Checker 3.0 > If (word1) and (word2) are both in the sentance Wordfast Pro | Translation Memory Software for Any Platform
Exclusive discount for ProZ.com users!
Save over 13% when purchasing Wordfast Pro through ProZ.com. Wordfast is the world's #1 provider of platform-independent Translation Memory software. Consistently ranked the most user-friendly and highest value
Buy now! » |
| Trados Business Manager Lite | Create customer quotes and invoices from within Trados Studio
Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.
More info » |
|
| | | | X Sign in to your ProZ.com account... | | | | | |