![]() |
RegEx in Custom Profile Field
Having only worked with RegExes in AME, I see that vB handles them a bit differently. I want a Regex that matches typical YouTube URLs along with the extra stings that come along with them. I tried my Regex for my AME YouTube definition:
Code:
^http://[\w.]+youtube\.[\w]+/watch[\?\#!]+v=([\w-]+)[\w&;+=-]*[\#t=]*([\d]*)[&;10shdq=]*|^$ http://www.youtube.com/watch?v=is_b1ahWN3Q http://www.youtube.com/watch?&v=is_b1ahWN3Q http://www.youtube.com/watch#!v=is_b1ahWN3Q http://www.youtube.com/watch?v=is_b1ahWN3Q&some_string=also_with_special_characters_&;+=- And deep linking examples. http://www.youtube.com/watch?v=is_b1ahWN3Q#t=5m http://www.youtube.com/watch?v=is_b1ahWN3Q#t=5m7s http://www.youtube.com/watch?v=is_b1ahWN3Q#t=120s Or just be blank. Maybe my matches don't need to be this specific? |
This seems to work:
Code:
<?php and I get this output: Code:
Array ( [0] => http://www.youtube.com/watch?v=is_b1ahWN3Q [1] => is_b1ahWN3Q [2] => ) It seems the second string doesn't match because the pattern doesn't allow for & where it appears in that string. |
All times are GMT. The time now is 03:54 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|