Following precedent on this point is indeed a strong argument, which makes me like @hamishknight’s suggestion for using traditional extended mode, but emitting a warning for an internal space surrounded by literal characters (my option 1). I like that when Hamish proposed it, and it’s still compelling now.
Yes, understood, agreed, and well said.
The point I’m advancing for consideration here is that multiline regex literals may in fact be a “bad” feature in the presence of the builder DSL, which is not precedented in other languages that support multiline extended mode.
Swift is a language that is willing to be fairly opinionated about narrowing its syntactic options, especially in the service of readability and clarity. Consider the history of ++: the feature has some confusing behaviors around pre- / post-increment behavior (and parsing, for that matter!) that often tripped up people discovering it for the first time, but it was so long-precedented and so familiar that it seemed utterly essential. Of course Swift included the ++ operator! But over time, it turned out not to carry its weight.
Why not? Because of for x in a..<b. Language features not present in C (for-each loops and ranges) shifted the balance, and what once seemed essential became more burden that benefit. In the contentious debate over removing it, people brought up parallel points: It's useful in other languages! Copying and pasting existing code becomes harder! Why should the language get opinionated about there being a good way and a bad way when we could just provide the choice? But in the end, we removed the feature, and the language has not suffered greatly for it.
TL;DR: The presence of newer features can sometimes make longstanding, seemingly essential precedents inessential.
To be clear, I'm not 100% decided on this question myself here. I'm not sure that multiline extended mode is a situation that parallels ++. What I'm arguing for is seriously considering that it might be.