pipped to the post
The phrase "pipped to the post" refers to being narrowly beaten or outrun in a competition or race, usually at the very end or last moment. It implies coming in second place or losing by a small margin. The word "pipped" originally comes from the practice of marking or scoring a race by making a small notch on a post, and being "pipped to the post" means someone else's notch was made ahead of yours, indicating their victory.
An idiom is a phrase or expression that usually presents a figurative, non-literal meaning attached to the phrase. Does that sound fun? It can be!
Play Just Saying - the word game that makes learning idioms a good time on your mobile phone or tablet.