s/\s+//g;
Of course that doesn't verify your data, so you could use split instead (untested):
OUTER: while (<>){ chomp; my @items = split m/\s/; for my $i (@items) { last OUTER unless $i =~ m/^[a-f\d]{2}$/; } print join '', @items; }
In reply to Re: Help with parsing a string
by moritz
in thread Help with parsing a string
by sdolancu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |