Suggestions for Regex QA check: Verb "click" must be followed by preposition "on"

Hello,

Disclaimer: I'm a beginner where Regex is concerned, so apologies if this is a silly question!

I'd like to set up a Regex QA check to flag up target segments where I've forgotten to use the preposition "on" after the verb "click".

The best I've come up with is to enter Click [^o] in the RegEx target box, with "Report if target matches (target check only)" as the condition. But obviously this is case sensitive and doesn't cover "clicks", "clicking", "clicked".

Does anyone have any suggestions for a more "comprehensive" rule that would save me entering all the different variants (click, Click, CLICK, clicking, Clicking, CLICKING and so on and so on...!)?

Thanks,

Hayley

Parents Reply Children
  • Partly a real example (client wants "click on XYZ" rather than "click XYZ" in software user manuals), partly just trying to learn some RegEx...!

    May have got there though:

    (?i)click[^\s]* \b(?!on\b)\w+

    Which I believe means: "click", "clicks", "clicked" and "clicking" (case insensitive) must always be followed by the word "on" (case insensitive).

    Hayley

    Screenshot of Trados Studio's Regular Expression test results showing highlighted matches for the pattern 'click' followed by 'on'. Variations include 'clicked on', 'clicks on', and 'clicking on'.

    emoji


    Generated Image Alt-Text
    [edited by: Trados AI at 4:24 AM (GMT 0) on 5 Mar 2024]
  • Or just put this into the community advanced display filter:

    (?i)click[^\s]*\s(?!on)

    That will filter all segments that contain any of the click stuff that is not followed by on (in any case).  Then you can correct them.

    If you trust the results you could also search for this:

    (?i)(click[^\s]*)\s(?!on)(\w+)

    Replace with this:

    $1 on $2

    Although you might want to do this more carefully and pay attention to the case so that the word "on" can use the correct case in the replace.

    Paul Filkin | RWS

    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