I have a text file where all the question and answer is there like bellow text
question l : Regular expression problem in C#
answer 1 : regular expression answer 1
question 2 : Regular expression problem in php
answer 2 : regular expression answer 2
etc...
I made this like bellow
<question> question l : Regular expression problem in C# </question>
<answer> answer 1 : regular expression answer 1</answer>
<--page-->
<question>question 2 : Regular expression problem in php </question>
<answer>answer 2 : regular expression answer 1</answer>
<--page-->
So that i can made a array and foreach loop i can insert that to my data base in bellow table
question_id, question answer
1 Regular expression problem in C# regular expression answer 1
2 Regular expression problem in php regular expression answer 2
any one can help me to build the regular expression, i build this one but it include question text in answer text
preg_match_all("#^(?<!<question>).*<question>.*?</question>(?!.*<question>)#",$temp_data,$question);
preg_match_all("#^(?<!<answer>).*<answer>.*?</answer>(?!.*<answer>)#",$temp_data,$answer);