Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Can a regular expression include an arbitrary string variable?

by trippledubs (Deacon)
on Oct 17, 2019 at 02:49 UTC ( #11107575=note: print w/replies, xml ) Need Help??


in reply to Can a regular expression include an arbitrary string variable?

#!/usr/bin/env perl my $string_to_find = 'hidden'; my @array_to_search = ('Foo', 'whathiddenever', 'Bar', '12hidden456'); my @matches = grep { /$string_to_find/ } @array_to_search; print "@matches";
  • Comment on Re: Can a regular expression include an arbitrary string variable?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11107575]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2020-10-30 20:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (284 votes). Check out past polls.

    Notices?