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 comment Share on other sites More sharing options...
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 comment Share on other sites More sharing options...
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 comment Share on other sites More sharing options...
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 comment Share on other sites More sharing options...
bubu Posted June 1, 2005 Report Share Posted June 1, 2005 man nav problēmu. Link to comment Share on other sites More sharing options...
PheliX Posted June 1, 2005 Report Share Posted June 1, 2005 man nav problēmu. :D Link to comment Share on other sites More sharing options...
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 comment Share on other sites More sharing options...
Recommended Posts