Filter for words with initial cap, except Z (ignoring segment start)

Can anyone help me to filter for segments that contain a word that has any initial uppercase letter except for Z, and ignoring the first letter of the segment?

I've asked chatgpt and Gemini and neither came up with a solution that worked, even though I gave it prompts specifying the NET flavour and that ^ means the start of a segment.

Example segments that the regex should be identify:
Experience in Clinical Trials
In the general US population. 

but not Using Zeclan in infants

Thank you!

emoji
Parents
  •   

    Quite a tricky one and best to break these things down so you start simple, and then add to it, making sure that each iteration as the expression evolves works.  So this one seems to work for me in regex buddy... I didn't test in Studio:

    (?-i)^[A-Z][^\s]*\s(?!Z)[a-zA-Z]+\b.*$

    I used the mode modifier at the start simply to avoid any overriding case sensitivity problems.  Might not be needed in Studio.  Looks like this in regex buddy:

    Screenshot of text highlighted by a regex tool. Highlighted phrases include 'Experience in Clinical Trials' and 'In the general US population.' No visible errors or warnings.

    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


    Generated Image Alt-Text
    [edited by: RWS Community AI at 7:49 AM (GMT 1) on 25 Jun 2024]
Reply
  •   

    Quite a tricky one and best to break these things down so you start simple, and then add to it, making sure that each iteration as the expression evolves works.  So this one seems to work for me in regex buddy... I didn't test in Studio:

    (?-i)^[A-Z][^\s]*\s(?!Z)[a-zA-Z]+\b.*$

    I used the mode modifier at the start simply to avoid any overriding case sensitivity problems.  Might not be needed in Studio.  Looks like this in regex buddy:

    Screenshot of text highlighted by a regex tool. Highlighted phrases include 'Experience in Clinical Trials' and 'In the general US population.' No visible errors or warnings.

    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


    Generated Image Alt-Text
    [edited by: RWS Community AI at 7:49 AM (GMT 1) on 25 Jun 2024]
Children