Re: escape character in regex

2022-10-10 Thread John W. Krahn
On 2022-10-10 18:12, Henrik Park wrote: I know "/" is a special character for regex, which should be escaped. But if I put "/" in a variable and use the variable in regex, then it doesn't need the explicit escape. Like this one: $ perl -le '$delimiter="/"; $str="hello/world/buddy"; @list=sp

Re: escape character

2007-03-22 Thread Beginner
On 21 Mar 2007 at 20:05, Dr.Ruud wrote: > "Beginner" schreef: > > > The Iconv route hasn't been too successful either. I tried > > Text::Iconv->new('ISO8859-1','utf8'); > > Thinking that my data is currently ISO8859-1but the results were not > > as I had hoped. Where I had MICROSCÓPIO, I got MIC

Re: escape character

2007-03-21 Thread Dr.Ruud
"Beginner" schreef: > The Iconv route hasn't been too successful either. I tried > Text::Iconv->new('ISO8859-1','utf8'); > > Thinking that my data is currently ISO8859-1but the results were not > as I had hoped. Where I had MICROSCÓPIO, I got MICROSCÃPIO. I don't think you are showing all charact

Re: escape character

2007-03-21 Thread Tom Phoenix
On 3/21/07, Beginner <[EMAIL PROTECTED]> wrote: s/\xc9/'&#'.$1.';'/ # Hoping for É from É Your pattern didn't include parentheses, so there's no $1. Do you want something like this, maybe? s!([^\x20-\x7e])! '&#' . ord($1) . ';' !ge; Or you could just use HTML::Entities

Re: escape character

2007-03-21 Thread Beginner
On 20 Mar 2007 at 12:55, Chas Owens wrote: > On 3/20/07, Beginner <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I have a large, 1.3GB xml file that I was trying to validate. It > > turns out that the file has a lot of exotic characters in it such as: > > é > > è > > Ä > > È > > ...etc > > Being a la

Re: escape character

2007-03-20 Thread Chas Owens
On 3/20/07, Beginner <[EMAIL PROTECTED]> wrote: Hi, I have a large, 1.3GB xml file that I was trying to validate. It turns out that the file has a lot of exotic characters in it such as: é è Ä È ...etc The area of encoding and internationalisation is one I have no experience of at all and from

Re: escape character

2007-03-20 Thread yitzle
You can get the hex values from http://ascii-table.com/img/table-apple.gif You can escape them with \xdd where dd is the 0xdd hex value. eg s/[\x80-\xFF]/\?/ On 3/20/07, Beginner <[EMAIL PROTECTED]> wrote: Hi, I have a large, 1.3GB xml file that I was trying to validate. It turns out that the