Here is a solution. It works on the example you gave me.
Code:
program:
comments = field('comments');
contains( comments,
'(?i).*?last page read: location',
cmp(re( comments,
'(?is).*last page read: location \d+ \((\d+)%\).*',
'\1'),
94,
'No',
'No',
'Yes'),
'')
The right way to solve this problem is to write a user-defined formatter function in python, something that became possible in 0.7.40. The reason: it is much easier to deal with 'unexpected situations' when writing in python. For example, the above code absolutely depends on the characters in the parenthesis being digits. If they are not, then ugly 'exception' messages get printed.