![]() |
Need a quick help regarding regular expression (P
I need little help of any php programmer here for preg_replace.
What will be the regex to match following : Code:
[img width=320 height=217] Actually I need it for cleaner.php , asking here as on vbulletin.com, there is not much help in this matter. |
Not 100% sure of what you're trying to do but this would grab the values from the above string:
\[img width=(\d*) height=(\d*)\] so this: PHP Code:
width=320 and height=217 |
Using cleaner.php, I need to change all instances of [img width=320 height=217] to [img] in my forum which I recently converted from smf to vb.
I will try it and let you know. btw, just asking as I am still understanding regex, what does widht=\1 and height width=\2 stands for. ie. \1 and \2 , what they denote ? Thanx :) Update: Thanx buddy, it helped. |
Quote:
|
I need little more help..
What would be regex to match following : [youtube=425,350] rather I need to convert : Code:
[youtube=425,350]NN7XXCDqzVg[/youtube] Code:
[video]http://www.youtube.com/watch?v=NN7XXCDqzVg[/video] |
Use the following regular expressions:
Code:
/\[youtube=(.*)\](.*)\[\/youtube\]/im |
That would match whole following..
Code:
[youtube=425,350]NN7XXCDqzVg[/video] Put it in : [code][video]http://www.youtube.com/watch?v=NN7XXCDqzVg[/video] I can do following: PHP Code:
|
Use this:
PHP Code:
|
All times are GMT. The time now is 11:48 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:
|