|  | Posted by robert on 07/06/16 11:48 
"Gernot Frisch" <Me@Privacy.net> wrote in message news:4dfvjuF19pargU1@individual.net...
 |I don't know where to look for the syntax of that command.
 |
 |
 | Here's the string I have:
 | 0) Kung Fu : 1000n1) jack : 150n2) jim : 10n3) jonny : 0n
 |
 | It should split up in:
 | array('Kung Fu' =>1000, 'jack'=>150, 'jim'=>10, 'jonny'=>0);
 |
 | That's what I have found somewhere:
 | preg_match_all('/d+)s(.+)s:s(.+)/', $content, $tokens);
 |
 | But it gives:
 | Warning: preg_match_all() [function.preg-match-all]: Compilation
 | failed: unmatched parentheses at offset 2
 
 '\(\s*?([^:]*?)\s*?:\s*?(\d+)'
 
 something like that should get it...you didn't escape the first parenth, nor
 did you escape *any* of the space characters (\s)...nor would your
 expression have returned anything close to what your description of results
 shows.
 [Back to original message] |