I love programming in .NET / C#. Have been doing it since 2004 now. Much has changed since: the .Net framework is got more libraries, NuGet was a game-changer and even C# itself is evolving with lambda and dynamic.
And now .Net has evolved to Standard and Core with support for other platforms like Linux / Docker. Things are getting easier and faster.
Yesterday I was working on a bit of code that had to read the XMP meta data from a file. It is not located at a certain position, so I had to scan the file. XMP, being plain XML, can be found by simple string matching. After some searching I’ve found many solutions that read the entire file into memory and perform a regular expression search or a string comparison. That’s not going to work for me, because I have files that are +100MB! So I wrote some code that does a search that performs.
PowerShell runs on .NET and uses the .NET regex engine, but PowerShell adds its own string semantics. Two independent failures can break a capture-group replacement: multiline matching and PowerShell interpolating `$1` before it reaches the regex engine.
As a developer, I love solving common string problems with regular expressions. Sure, they are sometimes hard to read, but you can do so much with such a small expression! It is nice that many languages support them, although it sometimes feels like every language creates its own dialect. Let’s look at the differences between regular expression groups in .NET and JavaScript.