1

I have a string like

<dd>TF-AIDN, "Proposal for something...", Version 3.4, 18 November 2015 https://www.something.org/en/system/files/files/file-18nov15-en.pdf</dd>  

How can I modify the following statement to extract URL from such a string?

urlfinder = re.compile(r"((https?):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)", re.MULTILINE|re.UNICODE)

I am not able to figure out how can I modify the regular expression so that it takes < as the end mark of a URL instead of a space.

1 Answer 1

2

You can use this regex instead:

(http[^<]+)

Working demo

This will match a pattern having http and everything but <

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.