within an ace of

zamalo, “za dlaku”

I came within an ace of getting into an accident.
We were within an ace of beating the all-time record.
We were within a hair’s breadth of beating the all-time record.