dongyan5141 2011-07-29 18:25
浏览 73
已采纳

从完整域中删除域名[重复]

This question already has an answer here:

I'm looking for a quick way of getting parts of a domain name:

Example: http://www.mydomain.com/something/hello.html

I need to get the "mydomain.com" part and nothing else.

But, the url may change sometime, for example:

http://mydomain.com/something/hello.html

http://www.mydomain.com/hello.html

http://mydomain.com

Any help would be great,

Thanks!

</div>
  • 写回答

3条回答 默认 最新

  • douciwang6819 2011-07-29 18:27
    关注

    string parse to first instance of '.com' and strip the rest of the domain name from string

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 对于这个复杂问题的解释说明
  • ¥50 三种调度算法报错 采用的你的方案
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败