by Jonathan Bright | Nov 18, 2026 | Tutorials
A regex rewrite can keep accepting the same strings while changing the fields a caller reads. Before making a pattern easier to read, write down accepted and rejected inputs, then run both versions against that contract. This .NET 10 console tutorial pins a small...
by Jonathan Bright | Nov 18, 2026 | Tutorials
A loot table needs more than a random item index when coins should appear more often than crowns. Assign each item a weight, turn the running totals into boundaries, and return the first item whose boundary is greater than the draw. This complete .NET 10 console...
by Jonathan Bright | Nov 18, 2026 | Tutorials
Splitting an expression such as 3.5*(2-1) on its operators leaves only the numbers. A tokenizer needs the operators and parentheses too. With Regex.Split, a capturing group can keep those separators in the result. This tutorial builds a small tokenizer for + – *...
by Jonathan Bright | Nov 18, 2026 | Tutorials
A relative path such as images/logo.svg can stay under an allowed directory, while a/../../b can leave it. To distinguish them, first normalize the candidate against a fixed root, then inspect the path back from that root. Comparing the original text or a raw...