Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Regexp substitution using variables

by kcott (Archbishop)
on Nov 25, 2020 at 22:11 UTC ( [id://11124230]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $re = new Regexp($pattern);
    my $value = $re->substitute($value, replacement, $flags);
    
  2. or download this
    package Regex;
    
    ...
    }
    
    1;
    
  3. or download this
    #!/usr/bin/env perl
    
    ...
        $case_sens_re_obj->replace($test_string, '_'), "\n";
    print 'case_insens_re_obj substition: ',
        $case_insens_re_obj->replace($test_string, '_'), "\n";
    
  4. or download this
    case_sens_re_obj match: NO
    case_insens_re_obj match: YES
    case_sens_re_obj substition: ABC
    case_insens_re_obj substition: A_C
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2024-04-23 09:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found