
Full-stack engineering · Technical leadership
20 years of engineering. Built through delivery.
From user interfaces and APIs to SQL Server, financial-crime technology and production problem-solving.
Explore my experience
C# and data parsing
Extracting a date from mixed text using regular expressions and explicit date parsing.
Originally published by Apiuth Arun on C# Corner on 2023-10-11. Last updated there on 2025-02-18.
My original post demonstrates finding a date-like substring with a regular expression and then using DateTime.TryParseExact with explicit formats and invariant culture. It includes several differently formatted inputs and reports unsuccessful conversions. The key implementation choice is to align the extraction pattern with the actual input format.