Answer the question
In order to leave comments, you need to log in
How to separate protocol and host from url using regular expression?
There is https://www.site.com/en/
It is necessary to cut off /en/
To get https://www.site.com
But the options themselves may be different There are https://www.site.com/ru/ , https ://www.site.com/de/ , https://www.site.com/in/
Or maybe https://www.ar.site.com - in this case nothing is cut off
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question