SE-0351: Regex Builder DSL

I think it's a useful future direction! However, I wanted to clarify two things:

  • Regex's underlying representation is not the textual regex, but a general-purpose pattern matching program (for efficiency). So obtaining a textual regex from Regex would be a conversion.
  • Not every Regex built with regex builder can be converted to a textual regex. Regex builder supports arbitrary types that conform to the RegexComponent protocol, including CustomMatchingRegexComponent (pitched in regex-powered string processing algorithms) which can be implemented with arbitrary code. If a Regex contains a CustomMatchingRegexComponent, it cannot be converted to a textual regex.
7 Likes