My bookmarking app allows users to submit any URL. I want to clean/normalize these URLs using regex. Eg strip off query params or any chars prior to http*.
Eg:
https://www.amazon.com/Thursday-Murder-Club-Novel/dp/B086DL5TVZ/ref=sr_1_1?crid=1PPMMYS04059R&dchild=1&keywords=thursday+murder+club&qid=1635454753&sprefix=thursday%2Caps%2C346&sr=8-1
is cleaned to:
https://www.amazon.com/Thursday-Murder-Club-Novel/dp/B086DL5TVZ/ref=sr_1_1
using regex = ([^?]+)(?.*)?
Bonus: Once I can do this for a single regex, Iād like to chain regexes for more complex cleaning and standardization. So the result of applying regex1 feeds into regex2, etc.