Looking for some help with a javascript task involving regex and the split function. Here's what I need to achieve:
Input: http://www.google.com/some-page.html Output: http://www.google.com
I attempted the following code but unfortunately it didn't work as expected, only returning "."
href = href.split("com/")[0];
Apologies if this is a rookie mistake, still getting the hang of things! Any guidance would be greatly appreciated. Thank you!