Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Applying a RegEx in a variable

by ChOas (Curate)
on Aug 10, 2001 at 11:59 UTC ( [id://103786]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $String="1234A4321";
    my $RegEx="/a/i";
    
  2. or download this
    {
    $String=~/a/i;
    print "Match: ",$&||"none"," Pre: ",$`||"none"," Post: ",$'||"none","\
    +n";
    }
    
  3. or download this
    {
    $String=~$RegEx;
    print "Match: ",$&||"none"," Pre: ",$`||"none"," Post: ",$'||"none","\
    +n";
    ...
     };
     print "Match: ",$&||"none"," Pre: ",$`||"none"," Post: ",$'||"none","
    +\n";
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://103786]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2024-03-28 09:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found