Depends, If yours is a one piece regulator then you will nee to replace the whole item if your toilet has a chain and that is what broke take and repair the chain. For about $12.00 you can replace the entire float.
Shut off the water supply to at the toilet, disconnect the line supply line at the toilet then remove the the unit. the one piece float units come with great instructions and can be replaced by a non plumber in about 1 hour.