The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Reg Exp help
Hey guys, hopefully someone can help me with this, Im working on a script that parses another php file for an import, The file contains an insert statement that i neeed to extract the insert values from. I already have the files contents loaded into a var and i can extract the values i need using a messy combination of substr etc.
So for an example Code:
INSERT INTO " . TABLE_PREFIX . "tablename (field,field) VALUES (blah,blah) Cheers |
#2
|
|||
|
|||
If you already have "blah,blah", then why do you need to extract it? Please post the full code.
|
#3
|
|||
|
|||
It's kind of complicated and i'll try and explain it a bit better.
What i am doing is extracting a php file from a zip archive the contents of the extracted file are stored in a var, now at the moment i know i can get it working by writing outputing that var to a temp text file then looping through it line by line untill i find the correct insert statement and then disecting the line to get the values i need from the insert statement, I was more hoping that someone could help me with a pattern to find the insert statement in the var without having to write it out to a file first. at the moment there is no code but i know that i could do it the way above but would rather not have to write it out to a temp file. Cheers |
#4
|
|||
|
|||
Nobody can help you without knowing exactly what you trying to do.
You might wanna post your code here. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|