Regex to count capital letters

I was wondering how to check if there is a different number of capital letters by comparing source with target. I don’t want to check if the letters are the same, like if I am looking for translated acronyms or similar. I just need to know the number of capital letters in source, compare to target and in case it’s different, the rule should warn.

Is there a way of detecting such with regex?

Thanks in advance,


The Regex would be too cumbersome to elaborate, and you would need to create separate entries for each case (1 capital, 2 capital letters, etc).

Another option would be to develop a QA plugin but that requires programming skills.

So I would suggest instead to use Xbench Export Items function to export to an Excel file, then in Excel copy the A and B columns, do a global change of lowercase letter to nothing in those copied columns so that lowercase letters are wiped out and then use the LEN (lenght) function in Excel to compare the length of those two columns. If the length is different then it means that the count of capital letters is different.

Thank you for your suggestion, @pcondal. I was looking for something more integrated with Trados+Xbench to be able to do the check quickly, but I will look for a way to do it with an excel macro.
Kind regards,

A QA plugin would be integrated but, as mentioned, it requires to have someone with programming skills to develop this custom check.

QA plugins for Xbench are documented here: Programmer Reference-QA Plugins :: ApSIC Xbench Documentation and there is sample code here: GitHub - xbench/plugin-samples-vs-cpp: Samples of ApSIC Xbench plugins in Visual Studio C++