Word or idiom for 'when someone does something according to the regulation'

What's the word or idiom or expression for when someone does an activity or job according to regulations of the institute or situation.

Example: He won the match {abiding by or according to the rules}

Thanks in advance


Solution 1:

Fair and square: honestly and according to the rules.

Example: She won the election fair and square.

— Cambridge English dictionary


Or you could also say by the book.

By the book: exactly according to rules or the law

Example: The lawyers want to make sure we've done everything strictly by the book.

— Cambridge English dictionary


And single word would be legitimately.

Legitimately: In a way that conforms to the law or to rules.

Example: A legitimately elected government

— Lexico

Solution 2:

How about on the up-and-up?

From M-W:

up-and-up: an honest or respectable course -- used in the phrase on the up-and-up

From The Free Dictionary:

on the up-and-up: legitimate; open and aboveboard. Is this deal on the up-and-up? What's the catch? Everything I do is on the up-and-up. I am totally honest.

Your example:

He won the match on the up-and-up.