Do you know regex101.com ?
I found this wonderful regular expressions tester with explanation and help last week. It provides quick and clear regex pattern test before implementation and deployment. Let’s have a look!
Long queries and timeout
By default regular expressions execution time is limited to 2000 ms, which can be easily increased in settings menu in the right-top window corner
As regular expressions may be used in C# as well, however modifiers usage may be a bit confusing to programmers who are not familiar to regex in C#. RegexOptions enum provides most of necessary modifiers. Ungreedy modifier is missing but may be easily substituted by proper using of .*? and .* kind of patterns. Here is a sample usage of regular expressions in C# with modifiers:
public static DataBlock ParseBlockRegex(string blockString)
var rows = new List<string>();
var pattern = @"""(\d*?)"",""(.*?)""";
foreach(Match match in matches)
var row = new List<string>();
for (int i = 1; i < match.Groups.Count; i++)
return new DataBlock(rows);
As well, inline modifiers can be used. Here is a case insensitive example:
Regex MyRegex = new Regex(@"(?i)[a-z]+");