RegEx (:).
(?:[^\"]|(?:(?:.*?\"){2})*?)(?: |^)(?<kw>for|while|if)[ (]
. RegEx , @ . , RegEx , (,\w). , Multiline RegEx, (^) .
, . , . , , , ( RegEx), , . , .
Edit:
, , , .
var input = "while t < 10 loop\n s => 'this is if stmt'; for u in 8..12 loop \n}";
var pattern = "(?:[^\"]|(?:(?:.*?\"){2})*?)(?: |^)(?<kw>for|while|if)[ (]";
var matches = Regex.Matches(input, pattern);
var firstKeyword = matches[0].Groups["kw"].Value;
var keywords = matches.Cast<Match>().Select(match => match.Groups["kw"].Value).ToArray();
, ...