I'd love to see regexes be given the ability to declare constants and variables inline when they're used within a case condition, rather than requiring constants and variables to be declared outside the regex like a value-binding pattern would. For example:
if case /(?<let identifier>[[:alpha:]]\w*) = (?<let hex? = Int($0, radix: 16)>[0-9A-F]+)/ = string {
print(identifier, hex)
}
IMO this is much clearer, and aligns much better with Chris Lattner's original vision for regular expressions: