From c6407f93a8d38f04ec46d8868159f385396f73af Mon Sep 17 00:00:00 2001 From: root Date: Sun, 25 Apr 2021 20:32:25 +0000 Subject: Optimize regex by arranging the alternatives in the order of their likeliness to occur. --- lib/Apache/Inject/Handler.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Apache/Inject') diff --git a/lib/Apache/Inject/Handler.pm b/lib/Apache/Inject/Handler.pm index 10d9d0c..21be3c0 100644 --- a/lib/Apache/Inject/Handler.pm +++ b/lib/Apache/Inject/Handler.pm @@ -15,12 +15,12 @@ my $doc = qr{ (]*>)? \s* (]*>)? \s* ( ]*>.*? \s* - | ( ]*>.*? \s* - | ]*> \s* - | ]*> \s* + | ( ]*> \s* | ]*> \s* + | ]*>.*? \s* | ]*>.*? \s* # n.b. | ]*>.*? \s* # n.b. + | ]*> \s* )+ )? (]*>)? -- cgit v1.2.3