I have asp.net application where string is created in following way.
string abc;
abc="vindo|vindo|vind?40|vind?40|vincent van uden|vilm|vilm|slim?new|compas|*|darkc?loud";
Regex ABCRegex = new Regex(abc);
but It throws error.
at System.Text.RegularExpressions.RegexParser.ScanRegex()
at System.Text.RegularExpressions.RegexParser.Parse(String re, RegexOptions op)
at System.Text.RegularExpressions.Regex..ctor(String pattern, RegexOptions options, Boolean useCache).
I know the reason is because *, +, ?, {num, num} are "greedy quantifiers"
but is there any way to create RegEx using same string or is it possible to replace these greedy quantifiers with other characters?
I dont want to change my string.
Try this string:
abc = @"vindo|vindo|vind?40|vind?40|vincent van uden|vilm|vilm|slim?new|compas|\*|darkc?loud";