extract_rules function

Extract Rules from file