正则:获取链接的主要域名

https://pianpai.com/xxxadas

1
https:\/\/[^\/]+

获取结果为:https://pianpai.com

http与https的区别

http://pianpai.com/yyyyyyy

1
http:\/\/[^\/]+

获取结果为:http://pianpai.com

Leave a Reply

You must be logged in to post a comment.

RSS feed for comments on this post. TrackBack URL