use find_instruction_by_re to refactor code