php preg_split: how now to include all regex for splitting?

£cho

New Member
Given the following sentence:\[code\]The is 10. way of doing this. And this is 43. street.\[/code\]I want preg_split to give this:\[code\]Array ( [1] => "This is 10. way of doing this" [2] => "And this is 43. street")\[/code\]I am using:\[code\]preg_split("/[^\d+]\./i",$sentence)\[/code\]But this gives me:\[code\]Array ( [1] => "This is 10. way of doing thi" [2] => "And this is 43. stree")\[/code\]As you can see, last charachter of sentence is disappeared. I know why this happens, but I don't know how to prevent it from happening. Any ideas? Can lookaheads and lookbehinds help here? I am not really familiar with those.
 
Top