Perl Monk, Perl Meditation | |
PerlMonks |
Re: Regex Parsing Chars in a Lineby swl (Parson) |
on Nov 24, 2019 at 20:53 UTC ( [id://11109158]=note: print w/replies, xml ) | Need Help?? |
The . metacharacter matches spaces as well. From your input data it would appear that any hyphen surrounded by spaces is what you want to separate on? For example qr/\s\-\s/ You might also look at using Text::CSV_XS for the parsing. See https://metacpan.org/pod/Text::CSV_XS#sep for how to use multiple characters.
In Section
Seekers of Perl Wisdom
|
|