Personally I prefer to be explicit in routines, using the OR operator (|).
way[power~"(^minor_line|line$)"]
It ensures it doesn’t return other entities you might not want & helps you remember what you were searching for if you want to reuse it 6 months later.