Detecting language please wait for.......
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 for this! I don't know if it's the most concise version(!), but this works:(c|C)(lic|LIC)(k|K|ks|KS|ked|KED|king|KING) [^o]
Maybe use this to find the click variants in any case:
You can say both. Naturally I would say/write "Click something" too, hence the interest in flagging up segments for this particular client who insists on the preposition! But as I said to Paul, I was partly…
One takeaway from a blogpost by Nora Díaz is the use of the "pipe" in RegEx
so you should be able to do a RegEx involving
click|clicks|clicking|clicked or maybe even click(s|ing|ed)
I suspected there must be a more concise version...! There's a slight problem though. I tried this and it doesn't pick up anything with just "click" (clicks, clicked and clicking are all ok) - see screenshot below. I think this is because [^\s]+ means one or more non-space characters(?)
Can you suggest a modification?
(?i)click[^\s]* - Paul requested at least one character attached to "click" by using + as quantifier, which means one or more. * means zero or more. So try this instead.
My bad... use this:
Actually, I may have got there:
Although I've now realised this wouldn't catch anything where the second words starts with an "o", like "Click Open".
Oh sorry Jerzy Czopik I didn't see you'd replied in the meantime.
Hayley said:Although I've now realised this wouldn't catch anything where the second words starts with an "o", like "Click Open".
So what exactly are you trying to achieve here?
Hayley said: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".
If this isn't translated then check to see if the source finds this:
Then check to see if the target finds the same thing.
Would you say in English "click on something"? This is new to me, as I always understood it should be "click something". Click the button, not "Clickon the button". This has nothing to do with the regex in question here, is just my pure curiosity to learn English better. So forgive for kidnapping your topic, but it is always good to learn something... Thanks
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:
Which I believe means: "click", "clicks", "clicked" and "clicking" (case insensitive) must always be followed by the word "on" (case insensitive).
Or just put this into the community advanced display filter:
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:
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.
You can say both. Naturally I would say/write "Click something" too, hence the interest in flagging up segments for this particular client who insists on the preposition! But as I said to Paul, I was partly just playing around with RegEx to try and understand more about how it works.
@Hayley: thank you for your kind answer. It is really important to me as a non-native English speaker with English as not working language. It helps greatly to improve.