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.