in reply to Parsing a line of text items
scratch it, this doesn't work. It could, but it takes too much efforts to figure it out.
Better use the Text::CSV approach
maybe
DB<45> p $_ 23 45.67 "John Marcus" Surname 23 45.67 "John Marcus" Surname DB<46> say $2 while /(?:^|("|\s+))(.*?)\1/g 45.67 John Marcus Surname 45.67 John Marcus Surname DB<47>
Here are dragons, no guaranty whatsoever.
as expected, it only works if it ends with a whitespace, and I had problems using (?:$|\1) at the end.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing a line of text items
by LanX (Saint) on Mar 30, 2021 at 12:20 UTC |