Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: checking particular part of string

by hippo (Vicar)
on Mar 07, 2014 at 12:12 UTC ( #1077372=note: print w/ replies, xml ) Need Help??


in reply to checking particular part of string

To make it generic you would need a capture group. eg:

echo sumanna | perl -pe 's/(na$)/uc($1)/e;'

Is this what you were after?


Update: for an example with more obvious genericism try:

echo sumanna | perl -pe 's/(..$)/uc($1)/e;'


Comment on Re: checking particular part of string
Select or Download Code
Replies are listed 'Best First'.
Re^2: checking particular part of string
by moritz (Cardinal) on Mar 07, 2014 at 12:17 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2015-07-30 11:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls