my $str = " abc def123abc def"; print "[$_]\n" for split / \s+| (?<=[[:alpha:]])(?=[[:digit:]])| (?<=[[:digit:]])(?=[[:alpha:]]) /ix, $str;