Sunday, 18 August 2013

How to search for a string that contains no whitespace in perl

How to search for a string that contains no whitespace in perl

my $string3 = "anima ls";
my $t3 = $string3 =~ /[^\s]+/;
print "$t3\n";
I wanted to write a regex that searches for a string containing no
whitespace. The above code works even if i give space.

No comments:

Post a Comment