preg_replace on digit word boundry help

From: Date: Mon, 18 Mar 2002 18:39:17 +0000
Subject: preg_replace on digit word boundry help
Groups: php.general 
Request: Send a blank email to php-general+get-88984@lists.php.net to get a copy of this message
hi, i'm trying to replace ever digit nondigit boundary with a "," in a string. i'm trying to get \d\D to be replaced with \d,\D and the reverse \D\d with \D,\d ... i'm not having any luck. $digiword = "123joe123" $replace = preg_replace("/(\d)(\D)/","\\1,\\2",$digiword); this ends up with $replace being 123,joe456 how can i also catch the joe456 to end up with 123,joe,456 any help would appreciated. thanks, joe

« previous php.general (#88984) next »