Assembler.Assembler.SectionCode.GetRegexOpcodes C# (CSharp) Method

GetRegexOpcodes() private static method

Goes through each line of code - if it is a valid opcode, it assigns a RegexOpcode to it.
private static GetRegexOpcodes ( string code ) : RegexOpcode[]
code string
return RegexOpcode[]
            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;
            }