All pastes #291024 Raw Edit

Someone

public text v1 · immutable
#291024 ·published 2006-12-24 17:41 UTC
rendered paste body
            string text = @"Hello, my first name is ABC
and my second name is DEF.
Third name is GHI.";

            Regex regex = new Regex(@"first name is (?<first>\w*) second name is (?<second>\w*)");

            Match match = regex.Match(text);

            string first = match.Groups["first"].ToString();
            string second = match.Groups["second"].ToString();
            string third = match.Groups["third"].ToString();