Find & Replace: Regex - "replace only first match and ignore others"

Hi SDL community,

I'd like to find and capture only the first "text" in each segment and replace it with e.g. "paraghraph

Segment 1: In years of attending school, most of us have dealt with a number of different technical texts, or texts intended to educate the reader in a particular subject or skill through in-depth study and practice texts.(do not capture or even when matched, do no replace this one)

Segment 2: Technical texts, such as a chemistry textbook or car repair manual texts, which represents any verse or prose work meant to be instructional text.

What would be the regex for:

Find: ......

Replace: .....

Parents
  • Paul and Anthony, I have a similar, yet different issue here, if I may.

    I'd like to match the space (\s) + whatever the text until the first occurence of "içinde", and then move this string just after the "olarak,"

    I tried to visualise it as below:

    Screenshot of Trados Studio showing a text segment with a red underline indicating an error at the word 'icinde'. There are handwritten annotations suggesting text movement.

    This is the actual text:

    Bileşik 001a şema 11'in adım 65'inde bildirilen usule uygun olarak, metil 5-(2-((7-(2-(((tert-butoksi)amino)trimetil)piridin-4-il)-2-izobutilbenzofuran-5-il)metoksi)fenil)asetat'tan (21b) (200 mg, 0,349 mmol) DCM (20 mL) içinde, TFA (5,269 mL, 8,49 mmol) kullanılarak hazırlanmıştır.

    (Content changed not to violate any right if any.)

    I'd very much appreciate if you could offer a solution.

     

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 4:36 AM (GMT 0) on 5 Mar 2024]
  • So the replacement string should be like this?

    Bileşik 001a şema 11'in adım 65'inde bildirilen usule uygun olarak, DCM (20 mL) içindemetil 5-(2-((7-(2-(((tert-butoksi)amino)trimetil)piridin-4-il)-2-izobutilbenzofuran-5-il)metoksi)fenil)asetat'tan (21b) (200 mg, 0,349 mmol) , TFA (5,269 mL, 8,49 mmol) kullanılarak hazırlanmıştır.

    I'm sure not, but it would help if you could correct it so we see what it should look like.  Looks simple enough once we know what to do.

    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

Reply Children