Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Regex: Case insensitive search but case sensitive replace

by ehdonhon (Curate)
on Nov 17, 2003 at 11:54 UTC ( [id://307631]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while ( chomp( my $line = <DATA> ) ) {
      $line =~ s/(Fred)/"$1"/i;
    ...
    Hello, my name is FRED!
    fREd went to the store.
    Nobody was home, except for freD.
    
  2. or download this
    my $tag = 'jane';
    while ( <DATA> ) {
    ...
    __DATA__
    - John is following jane
    - John is following Jane
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-19 22:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found