Reputation: 574
I wrote a line which makes what I want:
([a-zA-Z0-9]+\.[a-zA-Z]+)\/$
https://coinmarketcap.com/
https://www.buzzfeed.com/
https://www.refinery29.com/
https://www.businessinsider.com/
How can I make the same selection but instead of [a-zA-Z0-9] select anything that starts from // or .?
Upvotes: 0
Views: 26
Reputation: 18357
You can use this regex,
(?<=\/\/|\.)[^.]+\.[a-zA-Z]+\/$
Explanation:
(?<=\/\/|\.)
--> Look behind to ensure the text is preceded by either a //
or .
[^.]+
--> Captures anything except dot\.
--> Folowed by a literal dot[a-zA-Z]+\/
--> Followed by one or more letters and a /
$
--> End of stringUpvotes: 1