Re: Regular Expressions - multiplelines

2004-08-01 Thread Zeus Odin
Another alternative: #!/usr/bin/perl use warnings; use strict; my $eol = '[\n\r\x0A\x0D]'; $/ = ''; while () { print /^(.*):$eol([^ ]*)/ ? "$1/$2\n" : $_; } __DATA__ $/Dev/something/something.com/blah1: default.asp userExc 26/07/04 1:42p [TEST-DEV]F:\content\blah\wwwroot\bla

Re: Regular Expressions - multiplelines

2004-07-26 Thread John W. Krahn
Roman Hanousek wrote: Hi Hello, I have a txt file that contains the following info: Text start here $/Dev/something/something.com/blah1: default.asp userExc 26/07/04 1:42p [TEST-DEV]F:\content\blah\wwwroot\blah1 $/Dev/something/something.com/som

Re: Regular Expressions - multiplelines

2004-07-26 Thread Damon Allen Davison
Hi Roman, Roman wrote: > use strict; > > my $file = shift; > my $line; > > > open(IN, "<$file") || die "$!"; > while($line =) > { >$line =~ /(\$\S+):.(\S+)/is; > >print "match1: $1; match2: $2 \n"; > } I would redefine the record separator for your while loop to process each of the four re