regex for logical AND to find many nonsequential words

Hi 

Can not figure out how can I find two or more nonsequential words in a segment?

Say apple / peach / grapes in any order

(apple)(peach)(grapes)  doesn't work and I don't see any operator like logical OR (|) to use for that.

thanks

emoji
  • Hi

    ===

    Not available

    OpenAI's services are not available in your country.
    ====
    But can I just have it from some simple sources?
    emoji
  • Chat window showing a question about using regular expression in Trados Studio Editor to find two or more nonsequential words in a segment.

    you mean like this ?

    Wondering if this AI could fix the multiglitchy Trados studio and make it more human Slight smile

    that's a shame

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 10:34 AM (GMT 0) on 29 Feb 2024]
  • Screenshot of Trados Studio showing a search query example to find words 'apple' and 'banana' in any segment but not in sequential order.

    thought such search could be more human ...

    At least like a search within the results of first search results

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 10:34 AM (GMT 0) on 29 Feb 2024]
  • thought such search could be more human

    No doubt the question is more human, but I strongly believe a human needs to validate the ChatGPT output, as the answer some times is just useless, sometimes gives some tips to finish it off, and sometimes ChatGPT gives a good first shot.

    emoji
  • No doubt the question is more human

    I mean Trados could be more human and provide such functionality.

    Is there any search within the first search results available without typing regex ?

    emoji
  • I mean Trados could be more human and provide such functionality.

    This has been at least discussed here or in Paul’s blog, don’t remember now: to use an the ChatGPT API (or any other AI API) to have this functionality inside Trados Studio. Note that you sent your question to ChatGPT for free, but using the API would be a paid service, so will we (as users) be ready to pay this extra cost?

    To test regexes, you can use free websites, such as: https://regex101.com/

    To create regexes on a more human way, there is RegexMagic (paid tool and never tested, sorry). You can check its humanity here: https://www.regexbuddy.com/regexmagic.html

    :-)

    Is there any search within the first search results available without typing regex ?

    Sorry, I don’t know what you mean?

    emoji
  •   

    It is indeed difficult to use ChatGPT for regular expressions as it's so important to get the prompt right... which can be very tricky.  If you don't spell out completely clearly and without any possible ambiguity you can get the wrong answer or even no answer at all.

    Anyway... this should do it:

    (?=.*apple)(?=.*banana)(?=.*pear)

    If you put this into the advanced display filter it will filter out segments containing all three words and in any order.

    One thing ChatGPT is quite helpful for is creating sample texts... which is really useful as the majority of users never give us anything to test with!!

    Once upon a time in a small village, there was a fruit vendor named Tom who was well known for his clever marketing tactics. One day, Tom decided to introduce a new game to his customers involving an apple, a pear, and a banana. He would hide the fruits under cups and shuffle them around, challenging customers to guess the order.
    
    A curious monkey named Bongo, who loved both apple and banana, was intrigued by the game. Bongo found it amusing that his two favorite fruits were involved, but he had never tasted a pear before. He decided to give it a try and joined the crowd of eager participants.
    
    Tom shuffled the cups, and Bongo carefully observed the movements, hoping to win an apple or a banana, or even that mysterious pear. His eyes darted back and forth, trying to track the location of each fruit.
    
    The villagers were amazed by the monkey's determination, some of them rooting for Bongo to win a banana or a pear, while others hoped he would get an apple. The atmosphere was electric, and everyone was having a great time.
    
    Meanwhile, a tourist named Sarah arrived in the village and noticed the commotion. She saw Bongo and was captivated by the scene, believing it would make a hilarious story to share with her friends back home.
    
    Bongo finally made his choice, lifting the cup to reveal a shiny apple. Tom chuckled, congratulating Bongo on his win, but the monkey had his eyes on the prize. Bongo, now confident in his skills, insisted on playing again, hoping to win the elusive pear or another banana.
    
    The game went on, and the crowd grew larger. Tom felt like a true showman, making each reveal more dramatic than the last. After several rounds, Bongo had won not only an apple but also a banana and a pear. The monkey's determination had paid off, and the crowd roared in excitement.
    
    Sarah, still watching, couldn't help but laugh as Bongo triumphantly held up his fruity winnings. She snapped a picture of the victorious monkey, holding an apple in one hand, a pear in the other, and a banana between his feet.
    
    With a mischievous grin, Bongo decided to make a run for it, taking his prizes with him. The crowd burst into laughter as Tom chased after the monkey, who had outsmarted him with his fruit-cup game.
    
    And so, the village was left with a hilarious tale of a monkey, an apple, a pear, and a banana that would be retold for generations to come.

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji