andrisp Posted June 1, 2005 Report Share Posted June 1, 2005 kaa lai piespiezh ereg_replace vai preg_replace vai whatever_replace aizstaat tikai peedeejo okjuuranci? saprotu, ka pa taisno nevienai no shiim funkcijaam neko taadu nevar iebarot, bet varbuut ir kaadas citas metodes kaa to izdariit ? Link to post Share on other sites
Delfins Posted June 1, 2005 Report Share Posted June 1, 2005 kaa lai piespiezh ereg_replace vai preg_replace vai whatever_replace aizstaat tikai peedeejo okjuuranci? saprotu, ka pa taisno nevienai no shiim funkcijaam neko taadu nevar iebarot, bet varbuut ir kaadas citas metodes kaa to izdariit ? 18216[/snapback] nu matchu pareizo uzliec piemēram - "visus pēdējos ciparus" /([\d]+)$/ ^ = sākums $ = beigas Link to post Share on other sites
bubu Posted June 1, 2005 Report Share Posted June 1, 2005 Manurpāt viņam nevajag pēdējo simbolu [virkni] tekstā, bet tieši occuranci, kas var nebeigties pie teksta beigām. Link to post Share on other sites
Delfins Posted June 1, 2005 Report Share Posted June 1, 2005 Manurpāt viņam nevajag pēdējo simbolu [virkni] tekstā, bet tieši occuranci, kas var nebeigties pie teksta beigām. 18221[/snapback] kāda problēma ielikt starp () un $ izteiksmi kas nebūs līdzīga meklētajam? pēdējais protams ir tikai manuāli Link to post Share on other sites
bubu Posted June 1, 2005 Report Share Posted June 1, 2005 man nav problēmu. Link to post Share on other sites
PheliX Posted June 1, 2005 Report Share Posted June 1, 2005 man nav problēmu. :D Link to post Share on other sites
Delfins Posted June 1, 2005 Report Share Posted June 1, 2005 function myreplace($m) { global $count, $counter; $counter++; if ($counter<$count) return $m[1]; else return '--'; } $sp = '/(ab)/'; if ( preg_match_all($sp,$str,$arr) ) { $count = count($arr[0]); $newstr = preg_replace_callback($sp,'myreplace',$str); } līks, bet triviāls risinājums :) Link to post Share on other sites
Recommended Posts