docs icon indicating copy to clipboard operation
docs copied to clipboard

[^x] "end of" will be confused with ^x regex that mean at "start of", the inverse.

Open obewan opened this issue 7 years ago • 1 comments

Hi,

The ^ "endof" operator will be confused with the regex ^ "startof" operator. Consider an expression like "^word[^0]" that will mean "something that start with the end of..." (and it's a simple example, I guess some regex experts can find something more crazy). This is absolute confusing. Please consider use standards meanings when introducing semantics, not the inverse meaning. Should be better to use $ for last index, like in regex, like word[0$].

Regards


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

obewan avatar Aug 29 '19 10:08 obewan

Thanks for the feedback @obewan

This has already been decided, and won't be changed. Among other considerations, the $ token is used for a string interpolation expression.

The article correctly describes the current behavior.

As you encounter other language design considerations, you should post those issues on the dotnet/csharplang repo. That's where language design discussions take place.

BillWagner avatar Aug 29 '19 12:08 BillWagner