I’m torn on this. I personally quite dislike regular expressions (for reasons already stated), but I do think interoperation with other languages is important. For example, I think it’s important that front and backend validations of user input agree, and needing to re-express the same pattern in a different format introduces the opportunity for discrepancy, and thus, a bad UX.
On the flip side, I see this as like, a legacy interoperability feature, which I don’t think should justify language-level changes.
I was hoping that it could just piggy-back off raw string literals, like mentioned at the bottom of the main post. I guess the compiler wouldn’t have an issue syntax highlighting the contents as a regex, when the inferred type is Regex or whatever.
But then it occurred to me, that this faces the same issue as the sharp delimitation between identifiers between operator and identifier characters. It’s not that the compiler couldn’t be made to figure it out otherwise, but other code, like website highlighting (e.g. in GitHub), non-LSP connected editors, etc. wouldn’t be smart enough to do it.
Put succinctly: I think it’s an important goal to end up with a syntax that’s distinct enough that a “dumb” parser could readily identify it.