4 ms·
>So separate wildcards and literals, each prepended by length? That would be far, far less readable than using escape sequences. Wildcards do not need a prefix
by benibela 7y ago
>So separate wildcards and literals, each prepended by length? That would be far, far less readable than using escape sequences.
Wildcards do not need a prefix, when they always are a single character.
Here is a ordinary regex for a path:
C:\\foo\\bar\\.*\.txt
And here the regex in C:
"C:\\\\foo\\\\bar\\\\.*\\.txt"
But with lengths in a hypothetical syntax:
11:C:\foo\bar\.*4:.txt
22:11:C:\foo\bar\.*4:.txt
That is quite readable
> You can't even read your code now without an IDE. Making up some kind of DSL on the fly? Start counting string lengths again.
I like binary formats. The lengths are easy to see in a hex editor. 16 bytes in each line or something
You always depend on an IDE to decode the file. You could not read an UTF-8 file, if it would not decode the UTF-8 characters and show individual bytes. Or read ASCII if it were showing individual bits.