Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: case preservation in regexp

by perlsen (Chaplain)
on Feb 10, 2005 at 12:45 UTC ( [id://429695]=note: print w/replies, xml ) Need Help??


in reply to case preservation in regexp

Hi, just include
c instead of a

in your expression

$input='Cat cat'; $input =~ s#\b([Cc]at)\b#<span class="topic">$1</a>#g; print $input; #output #<span class="topic">Cat</a> <span class="topic">cat</a>

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-25 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found