Extract all urls in a string with python3

后端 未结 5 1873
执念已碎
执念已碎 2020-12-22 08:46

I am trying to find a clean way to extract all urls in a text string.

After an extensive search, i have found many posts suggesting using regular expressions to do t

5条回答
  •  误落风尘
    2020-12-22 09:12

    If you want a regex, you can use this:

    import re
    
    
    string = "Lorem ipsum dolor sit amet https://www.lorem.com/ipsum.php?q=suas, nusquam tincidunt ex per, ius modus integre no, quando utroque placerat qui no. Mea conclusionemque vituperatoribus et, omnes malorum est id, pri omnes atomorum expetenda ex. Elit pertinacia no eos, nonumy comprehensam id mei. Ei eum maiestatis quaerendum https://www.lorem.org

提交回复
热议问题