search

Home  >  Q&A  >  body text

Method to extract words: use regular expressions

How to extract the dog breed from this URL https://images.dog.ceo/breeds/husky/n02110185_11841.jpg? Considering that the variety changes, what is the regex to extract the content between breeds/ and next/?

P粉608647033P粉608647033444 days ago562

reply all(1)I'll reply

  • P粉176151589

    P粉1761515892023-09-15 16:16:51

    breeds\/([^\/] ) should meet your requirements.

    However, regular expressions don't seem to be suitable for this case. I suggest you parse the URL and extract the required part from the path.

    reply
    0
  • Cancelreply