Re: list or hash of replacement regex

2008-01-22 Thread Rob Dixon
Zhao, Bingfeng wrote: Hi list, I'm in trouble and hope who can work me out. I want to so some replacements, so I want to keep all replacement policies in a hash so that I can use them in a foreach loop, such as: my %policies = ( "abc" => "def", "jfk\s+" => "jfk ", "(\d+)u

Re: list or hash of replacement regex

2008-01-22 Thread John W. Krahn
Zhao, Bingfeng wrote: Hi list, Hello, I'm in trouble and hope who can work me out. I want to so some replacements, so I want to keep all replacement policies in a hash so that I can use them in a foreach loop, such as: my %policies = ( "abc" => "def", "jfk\s+" => "jfk ",

RE: list or hash of replacement regex

2008-01-22 Thread Zhao, Bingfeng
Thanks, Jeff. But for qr/(\d+)uu/ and 'uu\1' on '22uu', I got 'uu\1' instead of 'uu22'. -Original Message- From: Jeff Pang [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 22, 2008 5:02 PM To: beginners-list Subject: Re: list or hash of re

Re: list or hash of replacement regex

2008-01-22 Thread Jeff Pang
-Original Message- >From: "Zhao, Bingfeng" <[EMAIL PROTECTED]> >Sent: Jan 22, 2008 4:53 PM >To: beginners@perl.org >Subject: list or hash of replacement regex > >But perl complains, so I update it as: >my %policies = ( > qr/abc/ => "d

list or hash of replacement regex

2008-01-22 Thread Zhao, Bingfeng
Hi list, I'm in trouble and hope who can work me out. I want to so some replacements, so I want to keep all replacement policies in a hash so that I can use them in a foreach loop, such as: my %policies = ( "abc" => "def", "jfk\s+" => "jfk ", "(\d+)uu" => "uu\1" #... many p