private static RegexOpcode[] GetRegexOpcodes(string[] code)
{
var regexOpcodes = new RegexOpcode[code.Length];
for (int i = 0; i < code.Length; i++)
{
RegexOpcode op = Program.Opcodes.FirstOrDefault(opcode => opcode.Regex.IsMatch(code[i]));
if (op == null)
throw new ApplicationException(string.Format("Line {0} is incorrect: '{1}' does not exist, or a number in it is too big/small/malformed for the instruction.", i, code[i]));
regexOpcodes[i] = op;
}
return regexOpcodes;
}