From dd107ea3d822f14f08198135ae2fc5b3b1d454b6 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 26 Apr 2021 19:33:46 +0000 Subject: Fix regex bug, support HTML comments I added \s* after to match any potential newline (and, for good measure, whitespace) after . One would usually rather have this: My header than this: My header --- lib/Apache/Inject/Handler.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/Apache/Inject') diff --git a/lib/Apache/Inject/Handler.pm b/lib/Apache/Inject/Handler.pm index 0e054e7..ae81fbb 100644 --- a/lib/Apache/Inject/Handler.pm +++ b/lib/Apache/Inject/Handler.pm @@ -12,8 +12,11 @@ use Apache2::RequestUtil (); my $doc = qr{ \A (? \s* + ( )? \s* ( ]*> )? \s* + ( )? \s* ( ]*> )? \s* + ( )? \s* ( ]*> .*? \s* | ( ]*> \s* | ]*> \s* @@ -21,12 +24,16 @@ my $doc = qr{ | ]*> .*? \s* | ]*> .*? \s* | ]*> \s* + | \s* )+ )? - (]*>)? + ( )? \s* + ( ]*> )? \s* )? (? .*? ) - (? \s* )? + (? \s* + ( )? \s* + )? \z }xmsi; -- cgit v1.2.3