Extract string and return 3 columns

My answer is different from the standard answer but return same output.
My code: pattern=r'(https?)://(?<=://)([\w.]+)/?(.*)'
Standard answer:pattern = r"(https?)://([\w\.\-]+)/?(.*)"

But i dont understand why ://is excluded from (), if i did pattern=r'(https?://)(?<=://)([\w.]+)/?(.*)', it returned NaN for all 3 columns.why would it happen?

I am not sure I undersand (.*) . could someone help me? Thank you!!

I think your answer if fairly correct too,
:// is excluded from the () as you don’t want to capture it in the first group!
the dot . means any character
the star * means any number of times

and here’s some great help :smile:

Thank you @hosamnagar.ds

that website is super helpful!!