Mr. Price,
Sometimes I copy/paste your code samples as is, but more often I write it from scratch and/or modify them to see whether they can be implemented in a different way or how they will work in different conditions. But that regex
Regex csv = new("(?:^|,)(?=[^\"]|(\")?)\"?((?(1)[^\"]*|[^,\"]*))\"?(?=,|$)");
completely blows my mind and makes me sad. I look at this and wonder how much time would an average (or even more experienced) developer spend to "decompile" and debug this regexp. Especially if initial conditions/rules slightly changes.
Particular splitting in your book coud be done e.g. by
filmsDumb = films.Trim('"').Split("\",\"");
I see (on the SO) that above mentioned regex covers many cases like empty elements and mixed quoted/unquoted strings. And I have no doubts that regular expressions can be very powerful. But I think it is overcomplicated for the book example.
I apologize for bothering you.
Mr. Price,
Sometimes I copy/paste your code samples as is, but more often I write it from scratch and/or modify them to see whether they can be implemented in a different way or how they will work in different conditions. But that regex
completely blows my mind and makes me sad. I look at this and wonder how much time would an average (or even more experienced) developer spend to "decompile" and debug this regexp. Especially if initial conditions/rules slightly changes.
Particular splitting in your book coud be done e.g. by
I see (on the SO) that above mentioned regex covers many cases like empty elements and mixed quoted/unquoted strings. And I have no doubts that regular expressions can be very powerful. But I think it is overcomplicated for the book example.
I apologize for bothering you.