diff --git a/Library/Homebrew/language/node.rb b/Library/Homebrew/language/node.rb index ccd1467ada..cfa093e4db 100644 --- a/Library/Homebrew/language/node.rb +++ b/Library/Homebrew/language/node.rb @@ -96,7 +96,7 @@ module Language module_function # A regex to match potential shebang permutations. - NODE_SHEBANG_REGEX = %r{^#! ?(?:/usr/bin/(?:env )?)?node( |$)} + NODE_SHEBANG_REGEX = %r{\A#! ?(?:/usr/bin/(?:env )?)?node( |$)} # The length of the longest shebang matching `SHEBANG_REGEX`. NODE_SHEBANG_MAX_LENGTH = T.let("#! /usr/bin/env node ".length, Integer) diff --git a/Library/Homebrew/language/perl.rb b/Library/Homebrew/language/perl.rb index b163b1f85a..a7f43e9c5c 100644 --- a/Library/Homebrew/language/perl.rb +++ b/Library/Homebrew/language/perl.rb @@ -15,7 +15,7 @@ module Language module_function # A regex to match potential shebang permutations. - PERL_SHEBANG_REGEX = %r{^#! ?(?:/usr/bin/(?:env )?)?perl( |$)} + PERL_SHEBANG_REGEX = %r{\A#! ?(?:/usr/bin/(?:env )?)?perl( |$)} # The length of the longest shebang matching `SHEBANG_REGEX`. PERL_SHEBANG_MAX_LENGTH = T.let("#! /usr/bin/env perl ".length, Integer) diff --git a/Library/Homebrew/language/php.rb b/Library/Homebrew/language/php.rb index c8ec368022..9ef2cfc943 100644 --- a/Library/Homebrew/language/php.rb +++ b/Library/Homebrew/language/php.rb @@ -15,7 +15,7 @@ module Language module_function # A regex to match potential shebang permutations. - PHP_SHEBANG_REGEX = %r{^#! ?(?:/usr/bin/(?:env )?)?php( |$)} + PHP_SHEBANG_REGEX = %r{\A#! ?(?:/usr/bin/(?:env )?)?php( |$)} # The length of the longest shebang matching `SHEBANG_REGEX`. PHP_SHEBANG_MAX_LENGTH = T.let("#! /usr/bin/env php ".length, Integer) diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index e3c279e6f5..71c77442c3 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -112,7 +112,7 @@ module Language module_function # A regex to match potential shebang permutations. - PYTHON_SHEBANG_REGEX = %r{^#! ?(?:/usr/bin/(?:env )?)?python(?:[23](?:\.\d{1,2})?)?( |$)} + PYTHON_SHEBANG_REGEX = %r{\A#! ?(?:/usr/bin/(?:env )?)?python(?:[23](?:\.\d{1,2})?)?( |$)} # The length of the longest shebang matching `SHEBANG_REGEX`. PYTHON_SHEBANG_MAX_LENGTH = T.let("#! /usr/bin/env pythonx.yyy ".length, Integer)