Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 ( #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? | Other CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2023-02-07 05:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (38 votes). Check out past polls.

    Notices?