neteikshu Posted June 6, 2006 Report Share Posted June 6, 2006 ir kods.... $string='AA + "=+ ' " && + - xbc'; $a1 = '[\^\~\\\*\&\%\+\<\=\>\|\-]'; $a2='<font class="pieturzimes">\\0</font>'; $strings=eregi_replace($a1,$a2,$string); Viss straadaa, bet vajadzeetu lai tas kas ir starp divaam " vai ' vai ` to ieliek <font class="pedinjas">\\0</font> ieskaitot pedinjas (nomocijos visaadi, bet pagaidaam nesanaak) butu jaiskataas apmeram shadi: AA + "=+ ' " && + - xbc Link to comment Share on other sites More sharing options...
bubu Posted June 6, 2006 Report Share Posted June 6, 2006 Tev jau regexpā nemaz pēdiņu nav! Link to comment Share on other sites More sharing options...
neteikshu Posted June 6, 2006 Author Report Share Posted June 6, 2006 (edited) biju megjinaajis arii shaa : $a1 = '[\^\~\\\*\&\%\+\<\=\>\|\-] | ("/\"(.*)\"/")'; $a2[0]='<font class="pieturzimes">\\0</font>'; $a2[1]='<font class="pedinjas ">\\1</font>'; $strings=eregi_replace($a1,$a2,$string); taapat nekas nesanaak :( bij vel doma visu megjinaat sadaliit pa porcijaam un tad apstraadaat atseviskji...., bet kautkaa skjiet ka nebuus labi Edit: Megjinashu pajautaat savaadak $a1='@(\")(.*)(\")|(\')(.*)(\')|(`)(.*)(`)@U'; $a2='<font class="pieturzimes">\\0</font>'; echo preg_replace($a1,$a2,$string); Patreiz nomaina visus kas ir ieksh " vai ' vai ` Vajadzeetu taa lai tos tieshi neizmanto, bet izmanto to kas nav ieksh taam ".... teiksim lai parbauda [\^\~\\\*\&\%\+\<\=\>\|\-] un tiem nomaina krasu Kas trukst? Kur tas jaliek? Edited June 7, 2006 by neteikshu Link to comment Share on other sites More sharing options...
neteikshu Posted June 7, 2006 Author Report Share Posted June 7, 2006 Hm... vai tieshaam kaads nezina risinaajumu? Link to comment Share on other sites More sharing options...
[Ya] Posted June 7, 2006 Report Share Posted June 7, 2006 uzliec visam krāsu tādu ka vajag, un tad tiem kas ir starp pēdiņām uzliec melno krāsu ! Link to comment Share on other sites More sharing options...
neteikshu Posted June 7, 2006 Author Report Share Posted June 7, 2006 (edited) [Ya]... tas ir galiigi garaam jo: peec pirmas izteiksmes strings buus <font claas="klase1">text</font> un tur jau buus citas peedinjas kas vairs neatieksies uz izejosho stringu.... velreiz atlasiit un izlaist tos kur ir <font claas="klase1"> ? Jeega? probleema ir taa pati? Taa kaa tas nav atrisinaajums :( Edited June 7, 2006 by neteikshu Link to comment Share on other sites More sharing options...
[Ya] Posted June 7, 2006 Report Share Posted June 7, 2006 es vnk nesaprotu šitam būtību .... un īsti nesaprotu ko tu vēlies panākt .... Link to comment Share on other sites More sharing options...
GedroX Posted June 7, 2006 Report Share Posted June 7, 2006 Šis neiet? $a1 = '/([\'][^\']*[\'])|(["][^"]*["])|([`][^`]*[`])/'; $a2='<font style="color: red;">\\0</font>'; $strings=preg_replace($a1,$a2,$string); Link to comment Share on other sites More sharing options...
neteikshu Posted June 7, 2006 Author Report Share Posted June 7, 2006 GedroX: rezultaats ir taads pats kaa jau biju panaacis :( ar $a1='@(\")(.*)(\")|(\')(.*)(\')|(`)(.*)(`)@U'; Man vajag lai tieshi shie (kas ir starp ") neizpildaas un paareejiem (kas nav starp ", ' , ` ) izpildiitos shiss [\^\~\\\*\&\%\+\<\=\>\|\-] respektiivi visiem simboliem kas nav "" nomainiitos kraasa <font class="klase">//0</font> Link to comment Share on other sites More sharing options...
[Ya] Posted June 7, 2006 Report Share Posted June 7, 2006 GedroX:rezultaats ir taads pats kaa jau biju panaacis :( ar $a1='@(\")(.*)(\")|(\')(.*)(\')|(`)(.*)(`)@U'; Man vajag lai tieshi shie (kas ir starp ") neizpildaas un paareejiem (kas nav starp ", ' , ` ) izpildiitos shiss [\^\~\\\*\&\%\+\<\=\>\|\-] respektiivi visiem simboliem kas nav "" nomainiitos kraasa <font class="klase">//0</font> tad dari tā $string='AA + "=+ ' " && + - xbc'; $a1 = '[\^\~\\\*\&\%\+\<\=\>\|\-]'; $a2='<font class="pieturzimes">\\0</font>'; $strings=eregi_replace($a1,$a2,$string); $b1='@(\")(.*)(\")|(\')(.*)(\')|(`)(.*)(`)@U'; $strings=eregi_replace($b1,"<font class='klase'>".strip_tags("\\0")."</font>",$strings); Link to comment Share on other sites More sharing options...
neteikshu Posted June 7, 2006 Author Report Share Posted June 7, 2006 [Ya]: nee tevis ieteiktais variants atkal garaam :( zinu ka to var izdariit ar 1 izteiksmi, tikai man nesanaak :( jau labu laiku mocos un nekaa :( arii no shejienes meginaaju, n variantus , nu nesanaak , saprotu ka vel daudz jaamaacass, bet jaa buutu vismaz kaads piemeers kas paraadiitu, paareejo ta pats piedomaatu... Link to comment Share on other sites More sharing options...
Recommended Posts