Search This Blog

Saturday, April 3, 2010

Ignoring Whitespace with Regex(perl)

Programmer Question

Hello, I am using Perl Regular expressions.
How would i go about ignoring white space and still perform a test to see if a string match.
For example.



$var = "         hello     ";     #I want var to igonore whitespace and still match
if($var =~ m/hello/)
{



}


Find the answer here

No comments:

Post a Comment

Related Posts with Thumbnails