Regex cutting off anything after space in the url

Heres the current regex : const regex = /(https?://\S+)\s\n\s(Canonical|\d)/g; it gives back: "http://www.stjosephnewwaverlytx.net/Religious" want it to give me the full url: "http://www.stjosephnewwaverlytx.net/Religious" + " Education/Teachers and Staff/Lessons/Misc/Sacraments.jpg Tried for a couple of hours to get it working but with no luck. Any help would be appreciated. Thanks!
3 Replies
peterkyle01
peterkyle012y ago
Try const regex = /(https?://\S+/\S+)\s\n\s(Canonical|\d)/g;
DivMode
DivModeOP2y ago
hmm it just seems to not match anything
DivMode
DivModeOP2y ago
regex101
regex101: build, test, and debug regex
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET, Rust.
Want results from more Discord servers?
Add your server