Title |
Test
Find
Pattern Title
|
Expression |
\b(((\S+)?)(@|mailto\:|(news|(ht|f)tp(s?))\://)\S+)\b |
Description |
Whilst writing a plain-text to HTML function, I ran into the problem of links that users had written with <a> tags (as opposed to just writing the URL) were linking improperly. This regular expression returns many types of URL, and preceding characters, if any. This allows you to handle each type of match appropriately |
Matches |
|
Non-Matches |
www.deepart.org | deepart.org | 123.123.123.123 |
Author |
Rating:
Not yet rated.
Demo Gorgon
|
Source |
The concept of (ht|f)tp(s?) came from, I believe, TwoGuysFromRolla. The rest is yours truly. |
Your Rating |
|
Title: AAA
Name: UUU
Date: 6/17/2016 11:35:09 PM
Comment:
1- sozumoki.com/tolgaozturk
2- http://google.com
3- https://google.com
4- http://www.google.com/heygidihey
5- https://www.google.com
Title: Works
Name: Vu Quang Thang
Date: 2/26/2012 3:26:17 AM
Comment:
I tried it with PHP and it works perfectly. Thank you so much.