in reply to Proper use of //x
The regex itself is complex, because the element it's matching is complex. Here's the unadulterated regex:$COMMENT_rex = qr{ <!-- # opening <!-- [^-]* # 0 or more non hyphens (?: (?! -- \s* > ) # as long as it's NOT a --> - # - (?: - # - [^-]* # 0 or more non - (?: - [^-]+ )* # -, 1 or more non -, 0 or more times )? # optionally... [^-]* # 0 or more non - )* # 0 or more times -- \s* > # the ending --> }x;
Ick.$COMMENT_rex = qr{<!--[^-]*(?:(?!--\s*>)-(?:-[^-]*(?:-[^-]+)*)?[^-]*)*--\s*>};
|
|---|