0 votes
in D Programming by
Why Not Support Regular Expression Literals With The /foo/g Syntax?

1 Answer

0 votes
by

There are two reasons:

The /foo/g syntax would make it impossible to separate the lexer from the parser, as / is the divide token.

There are already 3 string types; adding the regex literals would add 3 more. This would proliferate through much of the compiler, debugger info, and library, and is not worth it.

...