diff options
author | root <root@rbsd.ankarstrom.se> | 2021-04-25 20:32:25 +0000 |
---|---|---|
committer | root <root@rbsd.ankarstrom.se> | 2021-04-25 20:32:25 +0000 |
commit | c6407f93a8d38f04ec46d8868159f385396f73af (patch) | |
tree | cab86c4e2e210773bdee94f8bad628a45ff0caaa /lib/Apache/Inject | |
parent | e0778a8e6ec87b34077776a72f01f4d0305ae7e2 (diff) | |
download | Apache-Inject-c6407f93a8d38f04ec46d8868159f385396f73af.tar.gz |
Optimize regex
by arranging the alternatives in the order of their likeliness to
occur.
Diffstat (limited to 'lib/Apache/Inject')
-rw-r--r-- | lib/Apache/Inject/Handler.pm | 6 |
1 files changed, 3 insertions, 3 deletions
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{ (<!doctype[^>]*>)? \s* (<html[^>]*>)? \s* ( <head[^>]*>.*?</head> \s* - | ( <title[^>]*>.*?</title> \s* - | <base[^>]*> \s* - | <meta[^>]*> \s* + | ( <meta[^>]*> \s* | <link[^>]*> \s* + | <title[^>]*>.*?</title> \s* | <style[^>]*>.*?</style> \s* # n.b. | <script[^>]*>.*?</script> \s* # n.b. + | <base[^>]*> \s* )+ )? (<body[^>]*>)? |