I have the feeling, after using your VERY useful workflow, that we answer 2 different cases :
my solution : if the contents of a fold contain a specific pattern (and there can be as many different patterns as there are different words in the text), then keep open (unfolded) the fold with its contents your solution : if a pattern is found, and this pattern is bound to be more specific (@something, or as I tried #\d{3}, etc...), keep the fold unfolded with its contents wether the pattern is found in the header or found in the contents of the foldMy conclusion - and I am very grateful for your answer - is that these 2 solutions are complementary, for my specific uses anyway.
Thanks again for your help