On 06/03/2011 16:22, Shlomit Afgin wrote:

I have a data that contain unseen characters that I want to delete.
The unseen characters can be ^L, ^N and other sign that I cannot
copy  but I see them in my data.

Is someone know which regular can help me.

Hi Shlomit.

It would be better to list the specific characters that you want to
remove, but you could get away with the POSIX character class [:cntrl:].
A substitution like

  s/[[:cntrl:]]+//g

would remove all control characters (ordinals 0..31 and 127). A more
efficient way would be to avoid regular expressions and use tr///:

  tr/\x00-\x1F\x7F//d;

HTH,

Rob

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to