I am having some trouble developing a RegEx to create checklist item to check for a specific issue.
In the project I’m handling there are some variables that may appear once in a string or a couple of times. Therefore, I would need Xbench to check if the amount of times the variable appears in the source matches in the target as well.
Example:
<a:m> suffered at the hands of <b:m>. <a:m> then departed to hunt down <b:m>.
In this example, I would need Xbench to check whether <b:m> and <a:m> variables appear twice each in the Target text.
According to this post I understand the best way to set up this check with the checklist manager would be to use the @ expressions function and have a checklist item per variable. However, I have tried without success both with this function and with normal RegEx, but to no avail.
Some examples I tried to make it work:
Source: “[\<b:m\>]{2,}”
Target: -"[\<b:m\>]{2,}"
Mode Search: Regular Expressions
PowerSearch: ON
Source: “(\<b:m\>)=1([\<b:m\>]{2,})=2”
Target: -"@1" or -"@2"
Mode Search: Regular Expressions
PowerSearch: ON
The following search should detect all possible cases:
Target: \$[:space:]*g (\$[:space:]+g OR \$g[:space:]+ OR \$g[^\:]+[:space:]+\: OR \$g[^\:]+\:[:space:]+ OR \$g[^\:]+\:[^;]+[:space:]+; OR \$g[^\:]+\:[^;]+$)
Thank you so much for your reply, and my apologies for my delayed response.
I confirm that it looks to be working just fine, but I found another possible way for the variable to break. You can find the example below:
Source: If you return when you are wiser, I will regale you with tales of great heroics.
Target: Si vuelves cuando estés más preparado:preparada;, te deleitaré con historias de grandes proezas.
As you can see, in this case we are missing $g altogether. As with the examples provided in my previous message, in this case ($g missing altogether), we could also have more than 1 word before and after the colon.
What would be the updated search that takes this case into account, as well as the others?