in reply to Help with a small regex

The most obvious difference to me is the presence of a colon, which seems to be what you've used in your own logic. How about instead of returning true if it contains no colon, you try returning false if it contains one?
foreach (@data) { my $match = $_ if !/:/; }
The issue you are having is that you need the entire string to contain no colons, but what you have tested for is actually that it contains non-colon characters. The closest code to your spec would be
foreach (@data) { my $match = $_ if /^[^:]*$/; }
which says that all characters between the start and end of the string are not colons.

Advanced use case, this is exactly the sort of thing grep was made for:

my ($match) = grep !/:/, @data;

Update: Fixed typo in case two; thanks AnomalousMonk.


#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.