The ends have to match and if it's a tad long I fold and tape it (kapton tape gets my nod here).

So pitch and number of pins is what I match when I can't find the exact part. Too bad the laptop make model and year was omitted as for Apple we have another source to try.