in reply to Re: disregard spaces while matching ?
in thread disregard spaces while matching ?

No need to surround the \s+ with parenthesis. The only reason to use parenthesis is if you want to "capture" that part of the match. Using your example:
if( $test_string =~ /hello(\s+)world/ig ) { $spaces_between = $1; ### $1 comes from matching the ### expression in parenthesis $ct_spaces_between = length $spaces_between; print "FOUND IT! The number of spaces between 'hello' and 'world +' was $ct_spaces_between\n"; }
You should be able to use just /hello\s+world/ as your regular expression.

HTH.