Boldra has asked for the wisdom of the Perl Monks concerning the following question:
record1
field2 2345
record2
record3
field1 GAGGA
field2 7848
field2a 5m
Each field is slightly indented, with a record always beginning at column 4.Which only returns the first line of a given record, as though my "." wasn't matching \n.foreach $record ($formatted_data =~ m/(^ {3}\w.*)/mg) { &process_record($record); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex not greedy enough
by merlyn (Sage) on Nov 17, 2000 at 19:04 UTC | |
by snax (Hermit) on Nov 17, 2000 at 19:11 UTC | |
|
Re: Regex not greedy enough
by snax (Hermit) on Nov 17, 2000 at 18:16 UTC | |
|
Re: Regex not greedy enough
by japhy (Canon) on Nov 17, 2000 at 18:19 UTC | |
|
Re: Regex not greedy enough
by Boldra (Curate) on Nov 17, 2000 at 18:46 UTC | |
by japhy (Canon) on Nov 17, 2000 at 19:16 UTC | |
by snax (Hermit) on Nov 17, 2000 at 19:01 UTC | |
by Fastolfe (Vicar) on Nov 17, 2000 at 20:25 UTC |