Re: Fail to match mixed quote pattern

2014-03-14 Thread Anant kumar
Hi everyone, I am trying to write a script to search on the internet for different keywords (like Organism name, metabolic reactions and Genes involved). Can anyone suggest me how to proceed. I don't want to attach the link to any website like what CGI module perform. Just w

Re: Fail to match mixed quote pattern

2014-03-14 Thread Charles DeRykus
On Fri, Mar 14, 2014 at 4:26 AM, Alex Chiang wrote: > I tried to extract string from perl script, so I wrote following script: > > 5# matching string > 6 # sting start with ' or ". > 7 # assume string is on same line. > 8 # > 9 my $pattern = '(\"|\').*\1'; > 10 my @array; > 11 open (m

Re: Fail to match mixed quote pattern

2014-03-14 Thread Alex Chiang
Lovely, it works. I didn't know how to describe this, now I knew there is a global mode XD Thanks. --- Regards ! Alex Chiang

Re: Fail to match mixed quote pattern

2014-03-14 Thread Paul Johnson
On Fri, Mar 14, 2014 at 10:26:39PM +1100, Alex Chiang wrote: > Hi all, > > I tried to extract string from perl script, so I wrote following script: > > 5# matching string > 6 # sting start with ' or ". > 7 # assume string is on same line. > 8 # > 9 my $pattern = '(\"|\').*\1'; > 10

Fail to match mixed quote pattern

2014-03-14 Thread Alex Chiang
Hi all, I tried to extract string from perl script, so I wrote following script: 5# matching string 6 # sting start with ' or ". 7 # assume string is on same line. 8 # 9 my $pattern = '(\"|\').*\1'; 10 my @array; 11 open (my $file, "<", "str"); 12 while (my $line = <$file>) {. 13