Im using a regex expression on a string and i have the issue that there is nothing to the left of the string which doesnt reaccur in the string multiple times.
">something">tofind</a>
this part:
</a>
is unique in the string but the
">
part to the left is NOT
how can i make an expression take the first "> to the left of the (to be matched) value and not the first one from the start of the string
\">(.*)</a>
doesnt work properly due to that and gives me ">tofind and rightfully so.
any solution? i would like the solution to my problem be inside the expression and not additional code. due to my inabillty to hardcode a fix for every special problem i might have with strings.
thanks alot!
code processing the string
var regex = new Regex(regexstring);
var matches = regex.Matches(line);
foreach (var singleuser in matches.Cast<Match>().ToList())
{
allusernames.Add(singleuser.Groups[1].Value);
}