[Israel.pm] Removing meta characters (^[[1m and ^[[0m) from a file

Erez David introx at gmail.com
Sun Jun 27 03:05:11 PDT 2010


Hi,

It looks like chr(27)
the code which creates it is the following: printf "\33[1mSOME TEXT\33[0m"

On Sun, Jun 27, 2010 at 12:18 PM, Gabor Szabo <szabgab at gmail.com> wrote:

> I guess it is a chr(27) at the beginning, right?
> Gabor
>
> On Sun, Jun 27, 2010 at 12:08 PM, Erez David <introx at gmail.com> wrote:
> > s/\e[\[01]m//g  does't do the job. since the first [ is not a real
> character
> > it is a meta character...
> >
> > On Sun, Jun 27, 2010 at 12:02 PM, Shlomi Fish <shlomif at iglu.org.il>
> wrote:
> >>
> >> On Sunday 27 Jun 2010 11:27:02 Erez David wrote:
> >> > Hi,
> >> >
> >> > I am reading a file which has some meta characters in it.
> >> > This meta characters are: ^[[1m and ^[[0m which are used to bold some
> >> > text
> >> > out.
> >> >
> >> > I am looking for the best way to remove this meta characters from the
> >> > file
> >> > before I parse it. (Whether remove it by regex or any other way...)
> >> >
> >>
> >> You can use a regex. Untested:
> >>
> >> s/\e[\[01]m//g
> >>
> >> Regards,
> >>
> >>        Shlomi Fish
> >>
> >> > Thanks
> >> >
> >> > Erez
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://mail.perl.org.il/mailman/listinfo/perl
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.perl.org.il/pipermail/perl/attachments/20100627/a831c4fc/attachment.htm 


More information about the Perl mailing list