search

Home  >  Q&A  >  body text

javascript - Regular match one of multiple URLs?

https://ddd.comhttps://xxx.comhttps://bbb.com

I want to match the first https://ddd.com, how should I write it? The URL name is random
I wrote it myself /https:\/\/\w (?:\. com)/, but all URLs are matched, I only need the first

女神的闺蜜爱上我女神的闺蜜爱上我2779 days ago713

reply all(1)I'll reply

  • 高洛峰

    高洛峰2017-06-26 10:53:41

    What you need is lazy matching pattern

    /https:\/\/\w+?(?:\.com)/

    reply
    0
  • Cancelreply