Looking for good regex expression to find URLs in text

Found some on web, but don’t work for several URLs - does anyone have a favorite expression they use to find URLs in text?

Without much more information, i offer this one made with RegExRX:

[code]dim rx as new RegEx
rx.SearchPattern = “(?Umi-s)([a-zA-Z]{3,4}\:\/\/.*\s)”

dim rxOptions as RegExOptions = rx.Options
rxOptions.LineEndType = 4

dim match as RegExMatch = rx.Search( sourceText )
[/code]

Where’s Kem?

Out . You’re on your own today, people.

Although I thought I included a sample pattern for that with RegExRX.

What have you tried and what doesn’t work?

Yes, I did include such a pattern:

(?xi-U) # FREE SPACING, case-insensitive, greedy

# Define the prefix
(?(DEFINE)(?<prefix>[A-Z]{3,}://))
# Define a valid URL character
(?(DEFINE)(?<valid>[A-Z0-9\\-_~:/?\\#[\\]@!$&'()*+;=.,%]))

# START
\\b # Word boundary
(?: # Non-capturing group
(?<=\\<)(?&prefix)(?&valid)+(?=\\>) # Anything between angle-brackets
| # OR
(?<=\\[)(?&prefix)(?&valid)+(?=\\]) # Anything between square-brackets
| # OR
(?<=\\{)(?&prefix)(?&valid)+(?=\\}) # Anything between curly-brackets
| # OR
(?&prefix)(?&valid)+(?<![\\.,]) # Can't end on a dot or comma
) # End non-capturing group

Here is the description from the file:

This pattern will attempt to identify a URL. It contains four versions. The first three will attempt to identify and include any valid-looking URL between angle-, square-, or curly-brackets. The final one will mathing almost any valid-looking URL anywhere within text, but will exclude any trailing dot or comma.

The benefit of this pattern is that it will include most URLs or attempted URLs. The drawback is, it will also include obviously invalid URLs.

These are included: <http://www.something.com>, https://something.com?index=1&page=2, ftp://ftp.com/, httttp://blah.com, http://this.and.that/?s=%40, <http://www.something.com/?m=,,,>, [ftp://3.4.], {url://www.1223.com,} ssh://www.one%4t.com, http://a.

This is not: htp3://www.something.com.

If you have RegExRX, you can get these samples from my website or right through the Help menu.

Excellent - thanks all.