and if you just needed the words without the punctuation marks:#!/usr/bin/perl use strict; use warnings; my $s = 'earth, wind & fire'; my @out = split /\b/, $s; print "$_\n" foreach (@out);
foreach (@out) { print "$_\n" if ($_ =~ /\w/); }
In reply to Re: splitting punctuation in a text
by eosbuddy
in thread splitting punctuation in a text
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |