Answer the question
In order to leave comments, you need to log in
How to extract values from a variable using C# regex?
In general, there is a line like this:
text:text2:text3
In this case, the first "text" always has the same length, the second "text2" is constantly changing, the third "text3" too.
You need to extract these three values, bypassing the ":" separators.
PS Tried like this:
Regex myReg = new Regex("\\<text>:<text2>:<text3>\\", RegexOptions.IgnoreCase);
foreach (Match m in myReg.Matches(TextSelected))
{
text = m.Groups["text"].Value;
text2 = m.Groups["text2"].Value;
text3 = m.Groups["text3"].Value;
}
Answer the question
In order to leave comments, you need to log in
^(?<text>[^:]*):(?<text2>[^:]*):(?<text3>[^:]*)$
I don't know what source you looked at, everything is very clear on MSDN: https://msdn.microsoft.com/en-us/library/bs2twtah(...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question