The ‘text between’ function can be used to define Calculated Values that extract numbers from text.

For example, for a FragileX Knowledge Base, the Online Information System sends results such as

(CGG)n repeat of 28 detected.

Here, the number 28 is significant. The question is, how can we build rules on it?

The solution is to define a Calculated Value “FragXNumber” with the formula

FrgXPCR text between “repeat of” and “detected”

This will have the value 28, as required.

A complication is that the Online Information System sometimes sends results such as

(CGG)n repeat of 31 and 47 detected.

In this case, both numbers are significant, and the Calculated Value FragXNumber will return “31 and 47” for cases like this, so we need to do something more sophisticated.

What we can do is build two further Calculated Values:

FragXFirstNumber = FrgXPCR text between “repeat of” and “and”

and

FragXSecondNumber = FrgXPCR text between “and” and “detected”

For cases with just a single number, FragXNumber will have that number and the other two Calculated Values will be blank:

For cases with two numbers, FragXNumber will give a non-numerical value (containing “and”) and FragXFirstNumber and FragXSecondNumber will give the two numerical values:

It is now a simple matter to build rules based on these Calculated Values.