我希望捕获www.my-website.com/buy/
和-PERMANENT.html
之间的字符串(如果存在),但我很难这样做。我不确定如何创建一个忽略连续字符串的捕获组。到目前为止,我的尝试失败了。
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)