From 11817fe1f7d9abf9960fc42598f13c12699d5889 Mon Sep 17 00:00:00 2001 From: Nikoli Dryden Date: Mon, 5 Mar 2018 19:44:11 -0600 Subject: [PATCH] Generalize the regex determining the Xcode version. The current regex only matches a single digit for each component of the version (e.g. 9.2). This modifies it to match multiple digits in each component, so that e.g. 10.42 will be matched. --- Library/Homebrew/os/mac/xcode.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index f977a066da..2e4ec63819 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -131,7 +131,7 @@ module OS xcodebuild_output = Utils.popen_read(xcodebuild_path, "-version") next unless $CHILD_STATUS.success? - xcode_version = xcodebuild_output[/Xcode (\d(\.\d)*)/, 1] + xcode_version = xcodebuild_output[/Xcode (\d+(\.\d+)*)/, 1] return xcode_version if xcode_version # Xcode 2.x's xcodebuild has a different version string