Re: multi-line RegExes and extended mode.
I'd tend to agree here.
Worth noting that, while I could imagine some people might be concerned that using the Builder DSL for the same regex would make things too verbose or too different from a multi line extended regex that you'd copy-paste from elsewhere, I wanted to highlight that since it'll be valid to mix the DSL with literals, a middle ground would also be possible to be used already under the current proposals, which would lower the barrier of using this and, imho, make one more argument for not supporting multi line extended regex literals and push towards this instead:
let regex = Regex {
// Match a line of the format e.g "DEBIT 03/03/2022 Totally Legit Shell Corp $2,000,000.00"
let fieldBreak = /\s\s+/
/(?<kind>\w+)/; fieldBreak
/(?<date>\S+)/; fieldBreak
/(?<account>(?:(?!\s\s).)+)/; fieldBreak // Note that account names may contain spaces.
/(?<amount>.*)/
}
To me the mere possibility of using this when you need multi line and comments means that supporting extended mode in multiline literals is probably not worth it (given the debate / ambiguity of which white spaces would be trimmed if we wanted to support it)