Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 YouTube profile ID regex
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: YouTube profile ID regex
I'm not too sure how you'd differentiate between a channel and a user (is there a distinction?), but you could just simply take your existing regex and make the first part optional.

Code:
(?:((http|https):\/\/|)(www\.)?youtube\.com\/(channel\/|user\/))?[a-zA-Z0-9]{1,}


It's probably possible to just store the ID in the database if you make use of the input formatter (find the last '/' character and take everything from there).


My Blog
12-27-2014 10:38 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
YouTube profile ID regex - Zenk - 12-27-2014, 09:48 AM
RE: YouTube profile ID regex - ZiNgA BuRgA - 12-27-2014 10:38 AM
RE: YouTube profile ID regex - Zenk - 12-27-2014, 11:10 AM
RE: YouTube profile ID regex - ZiNgA BuRgA - 12-27-2014, 05:00 PM
RE: YouTube profile ID regex - Zenk - 12-27-2014, 07:17 PM
RE: YouTube profile ID regex - ZiNgA BuRgA - 12-28-2014, 02:59 PM

 Standard Tools
Forum Jump: