Ditto 4.8is...if your safety string has snapped into 2 separate pieces...it is NOT sold separately.
You can do as mentioned in the earlier posts and try to patch the two halves back together with heatsink...but more than likely it will fail again if the "cord" is becoming brittle.
You're more likely to have better success with the 2nd suggestion and that is to cut the cord...and forget about it. Just insert the cap into its little green holder when refueling. At least the only way to loose it would be to drive off with the fuel flap still open.
(the image below is from my 99 540iT...but same concept)
Or you can order a new fuel filler cap...which will come with a new cord attached. See #22 in the diagram and part nbr index: