Hi and thanks for your help!
It really glad for your help.
One more question
how do I print all matches?
There are many rows matching the expresion, how do I get out all rows matching the expression?
//jonas
Chris King wrote:
ereg("."(.)", "(.)", (.), ")
First of all, you see the " in the middle? All of those need to be escaped or you'll get a parse error. I prefer preg_match (same concept) lets take a look at that:
preg_match("/.?\"(.)?\", \"(.)?\", (.)?, /", $string, $matches);
Note first that I escaped all of the " with backslashes, to make them parse correctly. Next, I put a question mark after any ., reason being is that it turns it "non-greedy". If you just use ., it will match everything in the string, and you will not get what you are looking for. This tells it "Match only what you need".
Well, I hope that helps.
Chris King