xiaoyafeng has asked for the wisdom of the Perl Monks concerning the following question:
But it failed,because some string like "6.3,r1" include comma!Someone tell me to use (?key).Is it right?while (<DATA>) { /^.*?,.*?,.*?,(.*?),/; print "$1\n"; } __DATA__ 6,0,3,"8.1",1 7,578,,"8.2,r1",1 8,0,5,"8.2,r3",1 18,0,13,"6.2",1 19,D610,,"6.3,r1",1 20,2f78,15,"6.3,r2",1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Nth match.
by ikegami (Patriarch) on Dec 14, 2006 at 09:27 UTC | |
|
Re: Nth match.
by bart (Canon) on Dec 14, 2006 at 12:03 UTC | |
|
Re: Nth match.
by shmem (Chancellor) on Dec 14, 2006 at 09:34 UTC | |
by xiaoyafeng (Deacon) on Dec 14, 2006 at 10:56 UTC | |
|
Re: Nth match.
by jonadab (Parson) on Dec 14, 2006 at 11:34 UTC |