One way to do it is with a loop. Something like
Code:
program:
for i in '0,1,2,3,4,5,6,7,8,9':
v = list_item($comments, i, '\n');
if substr(v, 0, 19) == 'Illustration de ' then
# compute the result
result = 'whatever';
break
fi
rof
Another way is to use re() to strip out the information of interest. Something like this:
Code:
re($comments, '(?ms)(?:^|.*\n)<p>bar(.*?)(\n|$)', '\1')
The re() function doesn't set the option to let .* match newlines which is why the flags (?ms) were added to the beginning.
The first method will be much slower but gives you more control over what happens if there isn't a match. The speed doesn't matter if you are doing the operation in search/replace or in the Action Chains plugin.