Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Is there any way to ignore certain words and keep it as it is when substituing hash values to a matched pattern in a string?

by mr_ron (Chaplain)
on Apr 03, 2018 at 00:57 UTC ( [id://1212211]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my $texttosub = 'log10(blackcat)*whitecat*(log10(orangeCat))';
    $texttosub =~ s/\b(?!log10)([a-zA-Z][A-Za-z_0-9]+)\b/$cats{lc $1}/ige;
    print "$texttosub\n";
    
  2. or download this
    log10(5)*10*(log10(20))
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2024-04-16 11:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found