hmnc Posted September 25, 2004 Report Share Posted September 25, 2004 Ir teksts - " blaa blaa(blaa-tekstsktest:teksts)yeyee)" kā lai visus (,-,:,/,) šitos simbolus atdala ar speisu (tukšumu), lai starp parastu tekstu un simboliem būtu atstarpe. ar regexpressiem jādala, bet diemžēl regexpresos zināšanas nav pietiekamas, lai to paveiktu, so jautāju pēc palīdzības. paldies. Link to comment Share on other sites More sharing options...
bubu Posted September 25, 2004 Report Share Posted September 25, 2004 (edited) $text = preg_replace('~[-:/]~', ' \0 ', $text); Edited September 25, 2004 by bubu Link to comment Share on other sites More sharing options...
hmnc Posted September 25, 2004 Author Report Share Posted September 25, 2004 (edited) $text = preg_replace('~[-:/]~', ' \0 ', $text); lielum liels paldies. a parastās iekaviņas nevar atdalīt? <? $text = preg_replace('~[\(\)-:/]~', ' \0 ', $text); ?> šitādu ieliekot ar speisu atdalās arī cipari, kas nav īpaši vēlams Edited September 25, 2004 by hmnc Link to comment Share on other sites More sharing options...
bubu Posted September 26, 2004 Report Share Posted September 26, 2004 - zīmei jābūt uzreiz aiz [: $text = preg_replace('~[-\(\):/]~', ' \0 ', $text); vai arī tai ar priekšā \ zīmi liec: $text = preg_replace('~[\(\)\-:/]~', ' \0 ', $text); Link to comment Share on other sites More sharing options...
hmnc Posted September 26, 2004 Author Report Share Posted September 26, 2004 lielumliels paldies! viss strādā!! Link to comment Share on other sites More sharing options...
Recommended Posts