Runs under Xcode, won't compile from cmd line

import Foundation
import RegexBuilder

let timeRE : Regex  = /\d+:\d\d.\d\d/
let inputLine = "12:34.56"

   if let result = try timeRE.wholeMatch( in: inputLine )
   {
      print( "matched: \(result.0)" )
   }

Runs and matches (as expected) when I build it from Xcode. But if I switch to a terminal window, CD into the directory containing main.swift, and execute:

swiftc main.swift

main.swift:8:24: error: consecutive statements on a line must be separated by ';'
 6 | import RegexBuilder
 7 | 
 8 | let timeRE : Regex  = /\d+:\d\d.\d\d/
   |                        `- error: consecutive statements on a line must be separated by ';'
 9 | let inputLine = "12:34.56"
10 | 

and a whole bunch of other errors.

Xcode enables the Regex literal syntax by default, command line builds do not (unless through xcodebuild). You’ll need to pass the upcoming feature flag to enable it, which I don’t have offhand.

swiftc -enable-bare-slash-regex main.swift

Got it. Thanks.
Interesting, I could have sworn other REs worked just fine from the command line. Maybe I only did DSLs...