Matt Harvey, the ultimate perfectionist, almost reached his goal last night. The Mets ace took a perfect game into the seventh inning, allowed just one baserunner and dominated the White Sox in a 1-0, 10-inning victory. And though Harvey wasn’t the winner, he was the unquestioned star of the night.

Mike Baxter got the walk-off single and Bobby Parnell (3-0) got the win, but it was Harvey who dominated Chicago and dazzled the crowd of 23,394. He struck out a career-high 12 in nine innings and allowed just an infield single to Alex Rios with two out in the seventh, all despite a nosebleed that started minutes before the game.

“I was having fun. Anytime you go out there and you’re able to pitch like that and get early outs like I did it’s fun,’’ said Harvey, philosophical about his near-miss.

Rios hit a grounder deep into the hole at short, Ruben Tejada tracked it down and made a leaping throw, but umpire Mark Carlson correctly called Rios safe by a whisker.

“It’s baseball. Things like that happen,’’ Harvey said with a shrug. “Ruben made an awesome attempt and it could’ve gone either way. Unfortunately, he was safe. In that hole it’s tough. Anything going away like that, I knew it’d have to be perfect.’’

Harvey almost was, with the Mets unable to break through against Newark native Hector Santiago. They didn’t score at all until Ike Davis worked a full-count walk, Juan Lagares moved him over with a sacrifice bunt, and Baxter — also the hero of Johan Santana’s no-hitter — sliced a ball to right field that ended the game and kept the Mets from squandering Harvey’s performance.

“That’s the best I’ve felt all year, Hopefully it continues,’’ said Harvey, who had pitching coach Dan Warthen shoving tissue in his nose in the bullpen right before the game. “All of a sudden [my nose] just started bleeding. I wiped my sleeve and saw it was red, That was a telling sign. They shoved as much stuff as they could up there to make it stop.’’

Harvey had pitched 6 2/3 no-hit innings last month in Minnesota until Justin Morneau homered off the foul pole. But Harvey — who hadn’t pitched since April 29 in Miami due to a rainout and pair of off days — was even stronger last night, sending the White Sox hitters back to the dugout flustered and frustrated all night.

“Every time we talk about this guy, it’s something new and different,’’ said manager Terry Collins, who didn’t second-guess himself after lifting Harvey after 105 pitches. “In the fifth inning I said I think tonight he’s going to pitch a no-hitter. He was throwing any pitch he wanted to for a strike, pitched out of the zone. Really, really impressive.’’