http://qs321.pair.com?node_id=308259


in reply to how do I check for this rule

/XXX\s*\n+YYY/sg;

UPDATE: I have misread the question first and thought that the monk wanted to find all occurances rather than validate them. Please read the answer that Roger provided below. That's what English being not the first language does for you -- my mistake.