I am working on a url scraper, and the website tends to include the referall source, but I cannot include that when saving it to a file later on. I was successful in getting it to grab everything after the "/". testwebsite.com/ubotstudio?ref=referral This is what I have so far: [^/]*$ testwebsite.com/ubotstudio?ref=referral How should I have it match everything before the "?" sign?