Refine the on method regexp rule to make it more readable