From: saeed ahmed on 27 Apr 2010 06:41 hello friends, I have used preg_replace('/[^0-9a-zð\~\!\@\$\%\^\*\(\)\;\,\.\'\/\_]/i', ' ',$match); for remove the special characters. its work fine. but the problem I want to remove special characters from this kind of sentence /// #: "'''''Amor''' é fogo que arde sem se ver,'' #: ''é ferida que dói, e não se sente,'' #: ''é um contentamento descontente,'' #: ''é dor que desatina sem doer.''" #:: ''- Camões'' /// its remove all special character including é, ã, õ, which I do not want to. I want to remove special character except these three. please suggest me... ----- Regards Saeed Ahmed http://saeed05.wordpress.com -----
From: Ashley Sheridan on 27 Apr 2010 06:50 On Tue, 2010-04-27 at 16:41 +0600, saeed ahmed wrote: > hello friends, > > I have used > > preg_replace('/[^0-9a-zð\~\!\@\$\%\^\*\(\)\;\,\.\'\/\_]/i', ' ',$match); > > for remove the special characters. its work fine. but the problem I want to > remove special characters from this kind of sentence > > /// > > #: "'''''Amor''' é fogo que arde sem se ver,'' > #: ''é ferida que dói, e não se sente,'' > #: ''é um contentamento descontente,'' > #: ''é dor que desatina sem doer.''" > #:: ''- Camões'' > > > /// > > its remove all special character including é, ã, õ, which I do not want to. > I want to remove special character except these three. please suggest me.... > > ----- > Regards > Saeed Ahmed > http://saeed05.wordpress.com > ----- Add those characters inside the square brackets. In regular expressions, [^] indicates a list of characters that *won't* be matched. Thanks, Ash http://www.ashleysheridan.co.uk
|
Pages: 1 Prev: Error handling strategies (db related) Next: Weird while issue |