Re: help about regex matching

2005-11-29 Thread Jeff Pang
oh,I see it finally.Thanks for everyone! 2005/11/29, John W. Krahn <[EMAIL PROTECTED]>: > Jeff Pang wrote: > > yes,John's code work well too.But I still don't know why this code > > can't run correctly: > > > > next unless /(\S+).*(\d+\.\d+\.\d+\.\d+)/s; > > > > When I run it,I get these results:

Re: help about regex matching

2005-11-29 Thread John W. Krahn
Jeff Pang wrote: > yes,John's code work well too.But I still don't know why this code > can't run correctly: > > next unless /(\S+).*(\d+\.\d+\.\d+\.\d+)/s; > > When I run it,I get these results: > > 364 2.168.2.20 > 286.4 2.168.2.21 > 264.4 2.168.2.22 > 138 2.168.2.23 > 562.3 2.16

RE: help about regex matching

2005-11-29 Thread Charles K. Clarkson
Pant, Hridyesh wrote: : Why are u using this. : local $/ = "\n\n"; Because I'm cocky! :) $/ is a special perl variable which is used to define the input record separator. It is set to "\n" as a default. By resetting it to "\n\n", I was able to get two lines at

RE: help about regex matching

2005-11-29 Thread Pant, Hridyesh
Why are u using this. local $/ = "\n\n"; -Original Message- From: Charles K. Clarkson [mailto:[EMAIL PROTECTED] Sent: 29 November 2005 13:43 To: 'Perl Beginners' Subject: RE: help about regex matching Jeff Pang <mailto:[EMAIL PROTECTED]> wrote: : Thanks

Re: help about regex matching

2005-11-29 Thread Jeff Pang
yes,John's code work well too.But I still don't know why this code can't run correctly: next unless /(\S+).*(\d+\.\d+\.\d+\.\d+)/s; When I run it,I get these results: 364 2.168.2.20 286.4 2.168.2.21 264.4 2.168.2.22 138 2.168.2.23 562.3 2.168.2.24 80.72.168.2.25 355 2.168.2

Re: help about regex matching

2005-11-29 Thread John W. Krahn
Jeff Pang wrote: > hi,list, Hello, > I have a file looking as below: > > 356.5 > 192.168.2.20 > > [snip] > > 612 > 192.168.2.31 > > ... > > > I want to get this result: > > 356.5 192.168.2.20 > 283.3 192.168.2.21 > 261.9 192.168.2.22 > ... > > > and,I write this regex for matching: > >

Re: help about regex matching

2005-11-29 Thread Jeff Pang
It's ok now.Thanks very much. 2005/11/29, Charles K. Clarkson <[EMAIL PROTECTED]>: > Jeff Pang wrote: > > : Thanks for Charles.That code can work well,but I still want > : to know how to do it with regex expression. > > use strict; > use warnings; > > local $/ = "\n\n";

RE: help about regex matching

2005-11-29 Thread Charles K. Clarkson
Jeff Pang wrote: : Thanks for Charles.That code can work well,but I still want : to know how to do it with regex expression. use strict; use warnings; local $/ = "\n\n"; while ( ) { chomp; printf "%-5s% 15s\n", /(.+)\n(.+)/; } __END__ HTH, Charles K. Clark

Re: help about regex matching

2005-11-28 Thread Jeff Pang
Thanks for Charles.That code can work well,but I still want to know how to do it with regex expression. 2005/11/29, Charles K. Clarkson <[EMAIL PROTECTED]>: > Jeff Pang wrote: > : I would like to use regex for my destination because the file > : size is large and having

RE: help about regex matching

2005-11-28 Thread Bedanta Bordoloi, Gurgaon
eff Pang [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 29, 2005 11:53 AM To: Perl Beginners Subject: help about regex matching hi,list, I have a file looking as below: 356.5 192.168.2.20 283.3 192.168.2.21 261.9 192.168.2.22 135.9 192.168.2.23 557 192.168.2.24 79.4 192.168.2.25 349 192.1

RE: help about regex matching

2005-11-28 Thread Charles K. Clarkson
Jeff Pang wrote: : I would like to use regex for my destination because the file : size is large and having much lines. An unnecessary regex would slow you down on a large file. HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 No regex needed

Re: help about regex matching

2005-11-28 Thread Jeff Pang
en keep exams... > It keeps the exams first and then teaches the lessons. > > > > -Original Message- > From: Jeff Pang [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 29, 2005 11:53 AM > To: Perl Beginners > Sub

RE: help about regex matching

2005-11-28 Thread Dhanashri Bhate
AM To: Perl Beginners Subject: help about regex matching hi,list, I have a file looking as below: 356.5 192.168.2.20 283.3 192.168.2.21 261.9 192.168.2.22 135.9 192.168.2.23 557 192.168.2.24 79.4 192.168.2.25 349 192.168.2.26 265.1 192.168.2.27 326 192.168.2.28 404 192.168.2.29 331 192.168

help about regex matching

2005-11-28 Thread Jeff Pang
hi,list, I have a file looking as below: 356.5 192.168.2.20 283.3 192.168.2.21 261.9 192.168.2.22 135.9 192.168.2.23 557 192.168.2.24 79.4 192.168.2.25 349 192.168.2.26 265.1 192.168.2.27 326 192.168.2.28 404 192.168.2.29 331 192.168.2.30 612 192.168.2.31 ... I want to get this resu

RE: Help about Regex

2003-01-29 Thread Mark Anderson
5:10 PM To: [EMAIL PROTECTED] Subject: Help about Regex I'm newbie.. Would u help me to explain this regex: =[td]s/$directory/ What is the meaning of [td]???, because there is no metacharacter or regex that use [td]. Thanks for your help.

Help about Regex

2003-01-29 Thread lielie meimei
I'm newbie.. Would u help me to explain this regex: =[td]s/$directory/ What is the meaning of [td]???, because there is no metacharacter or regex that use [td]. Thanks for your help. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign