So I'm wanting to figure out how do you exclude on some numbers from a string input. For example, If I were to input this "https://www.shoepalace.com/products/jordan-dr6287-486-air-jordan-5-low-doernbecher-mens-lifestyle-shoes-blue-multi?variant=41679925772494", I'd want "?variant=41679925772494" remove and keep the rest the same. I can't use a constant of "?variant=41679925772494" because I'm wanting it work across all string inputs, not the same one. what I have is below, but it removes all numbers within the link, rather than whats after "?variant=". Does anyone have any ideas on how I can go about this?
let updatedLink = link.replace("?variant=", "")
let variantLink = updatedLink.replace(/[0-9]/g, "")```