I'm looking to capture the string between www.my-website.com/buy/ and -PERMANENT.html if it exists, but am having trouble doing so. I'm unsure how to create a capture group that would ignore a consecutive string. My attempts have failed so far.
www\.my-website\.com\/buy\/([^-PERMANENT.html]*)
www.my-website.com/buy/fork (Capture fork)
www.my-website.com/buy/wand (Capture wand)
www.my-website.com/buy/ball-PERMANENT.html (Capture ball)
www.my-website.com/buy/bike-PERMANENT.html (Capture bike)
www.my-website.com/buy/base-PERMANENT.html-ball (Capture base)
www.my-website.com/buy/wall-PERMANENT.html-glue (Capture wall)