Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Regexp to match regardless of whitespace

by JavaFan (Canon)
on May 03, 2012 at 17:05 UTC ( #968778=note: print w/replies, xml ) Need Help??


in reply to Regexp to match regardless of whitespace

There's no modifier that let you skip anything.

If you're just grepping for string literals, it's trivial to change it to allow for spaces:

my $pattern = join '\s*', split //, "whatever"; while (<>) { print if /$pattern/; }
Otherwise, I'd do as suggested: remove the whitespace in the line, than apply the pattern.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://968778]
help
Chatterbox?
and dust plays in a shaft of sunlight...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2017-06-28 23:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (653 votes). Check out past polls.