RE: How to avoid this greedy match?

2008-01-28 Thread Nagrale, Ajay
Hi, I don't think '<' or '>' are meta characters in regular expression match. "<>" is reserved for opening the files given at command line argument. >>Aside from that, consider using [^<]* and [^>]* in place of .* If we use "[^<]* and [^>]*", regular expression will fail to match pattern like "

Re: How to avoid this greedy match?

2008-01-28 Thread yitzle
I'm not sure how it works, but I think <> or \<\> is a RegEx reserved character for word matching. Aside from that, consider using [^<]* and [^>]* in place of .* -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: file.db VS filedb

2008-01-28 Thread Gunnar Hjalmarsson
MK wrote: you know gunnar i would swear on my mothers grave that i tried using both "" and '' in this and it still would not work, otherwise i really really really would not have cried wolf...but in all honesty it does work now, so there's egg on my face Okay... ;-) however, my connection of

Re: file.db VS filedb

2008-01-28 Thread MK
you know gunnar i would swear on my mothers grave that i tried using both "" and '' in this and it still would not work, otherwise i really really really would not have cried wolf...but in all honesty it does work now, so there's egg on my face however, my connection of "dbmopen" with "DB_F

Re: How to match a token not be quoted?

2008-01-28 Thread Gunnar Hjalmarsson
Rob Dixon wrote: Gunnar Hjalmarsson wrote: Zhao, Bingfeng wrote: I want to a cure regex that match following requirements: given $line = 'abc abc "abc abcc" abcc', I want to replace all instances of "abc" that not in quotation with, say 'd', so I expect I get 'd d "abc abcc" dc'. $line =~

RE: How to match a token not be quoted?

2008-01-28 Thread Zhao, Bingfeng
Thanks for all replies here and your valuable help last time:) > -Original Message- > From: John W. Krahn [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 29, 2008 11:11 AM > To: Perl Beginners > Subject: Re: How to match a token not be quoted? > snip -- To unsubscribe, e-mail: [EMAI

RE: How to avoid this greedy match?

2008-01-28 Thread Nagrale, Ajay
Try out the following regular expression: perl -e '$str = "...442226zzz222...";print "1=$1\n" if ($str =~ /.+(.*222.*)<\/script>/);' The regeular expression is: .+