[buddypress-trac] [BuddyPress Trac] #5501: Custom xprofile field: URL

buddypress-trac noreply at wordpress.org
Mon Apr 21 05:23:21 UTC 2014


#5501: Custom xprofile field: URL
-------------------------+------------------
 Reporter:  sooskriszta  |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  2.1
Component:  XProfile     |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+------------------

Comment (by sooskriszta):

 Replying to [comment:9 boonebgorges]:
 > maybe we can find one that's a bit more generous and faithful to the URL
 spec.

 So far, I've found @diegoperini's to be the best:
 {{{
 _^(?:(?:https?|ftp)://)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)(?:\.(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)*(?:\.(?:[a-z\x{00a1}-\x{ffff}]{2,})))(?::\d{2,5})?(?:/[^\s]*)?$_iuS
 }}}
 Wanna take it for a spin?

 Here's the JS: https://gist.github.com/dperini/729294

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5501#comment:11>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list