The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
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 |
#3
|
|||
|
|||
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. |
#4
|
||||
|
||||
Quote:
|
#5
|
|||
|
|||
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] |
#6
|
|||
|
|||
Use the following regular expressions:
Code:
/\[youtube=(.*)\](.*)\[\/youtube\]/im |
#7
|
|||
|
|||
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:
|
#8
|
|||
|
|||
Use this:
PHP Code:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|