How to upper case letters in a pair of parenthesis by PERL?

Discussion in 'Perl Misc' started by sofin, Nov 17, 2009.

  1. sofin

    sofin Guest

    Input:
    "Modeltest: testing the model of (dna)-substitution"

    Output:
    "Modeltest: testing the model of DNA-substitution"

    Anyone knows how to do it by PERL? Thanks.
     
    sofin, Nov 17, 2009
    #1
    1. Advertising

  2. sofin

    C.DeRykus Guest

    On Nov 17, 2:21 am, sofin <> wrote:
    > Input:
    > "Modeltest: testing the model of (dna)-substitution"
    >
    > Output:
    > "Modeltest: testing the model of DNA-substitution"
    >
    > Anyone knows how to do it by PERL? Thanks.


    perldoc -f uc
    perldoc perlop (see \U in Quote and quote-like operators)

    --
    Charles DeRykus
     
    C.DeRykus, Nov 17, 2009
    #2
    1. Advertising

  3. On Tue, 17 Nov 2009 13:53:26 +0100, Tad McClellan <>
    wrote:

    > sofin <> wrote:
    >> Input:
    >> "Modeltest: testing the model of (dna)-substitution"
    >>
    >> Output:
    >> "Modeltest: testing the model of DNA-substitution"
    >>
    >> Anyone knows how to do it by PERL?


    > Sure. That is pretty easy to do in Perl.


    s/\((\w+)\)/uc($1)/eg
     
    Jochen Lehmeier, Nov 17, 2009
    #3
  4. sofin

    Willem Guest

    Jochen Lehmeier wrote:
    ) On Tue, 17 Nov 2009 13:53:26 +0100, Tad McClellan <>
    ) wrote:
    )
    )> sofin <> wrote:
    )>> Input:
    )>> "Modeltest: testing the model of (dna)-substitution"
    )>>
    )>> Output:
    )>> "Modeltest: testing the model of DNA-substitution"
    )>>
    )>> Anyone knows how to do it by PERL?
    )
    )> Sure. That is pretty easy to do in Perl.
    )
    ) s/\((\w+)\)/uc($1)/eg

    I think \U is preferrable to /e.


    SaSW, Willem
    --
    Disclaimer: I am in no way responsible for any of the statements
    made in the above text. For all I know I might be
    drugged or something..
    No I'm not paranoid. You all think I'm paranoid, don't you !
    #EOT
     
    Willem, Nov 17, 2009
    #4
  5. >>>>> "sofin" == sofin <> writes:

    sofin> Anyone knows how to do it by PERL? Thanks.

    I'm pretty sure the Protecting Escarpment Rural Lands organization
    (perlofburlington.org) isn't really commissioned to help you with your
    homework. And I'm not even sure that your Pupils are Equal, Reactive to Light
    at this point either.

    When you have a non-homework question about the Perl programming language,
    feel free to post again. :)

    print "Just another Perl hacker,"; # the original

    --
    Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
    <> <URL:http://www.stonehenge.com/merlyn/>
    Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
    See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
     
    Randal L. Schwartz, Nov 17, 2009
    #5
  6. sofin

    Guest

    On Tue, 17 Nov 2009 07:32:52 -0800, (Randal L. Schwartz) wrote:

    >>>>>> "sofin" == sofin <> writes:

    >
    >sofin> Anyone knows how to do it by PERL? Thanks.
    >
    >I'm pretty sure the Protecting Escarpment Rural Lands organization
    >(perlofburlington.org) isn't really commissioned to help you with your
    >homework. And I'm not even sure that your Pupils are Equal, Reactive to Light
    >at this point either.
    >
    >When you have a non-homework question about the Perl programming language,
    >feel free to post again. :)
    >
    >print "Just another Perl hacker,"; # the original


    You mean Perl is actually offered as a HS or college course and with homework?
    I find that hard to believe. It serves no purpose and has no reward.

    -sln
     
    , Nov 17, 2009
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Janice

    lower case to upper case

    Janice, Dec 10, 2004, in forum: C Programming
    Replies:
    17
    Views:
    1,227
    Richard Bos
    Dec 14, 2004
  2. sofin
    Replies:
    1
    Views:
    396
    Victor Bazarov
    Nov 17, 2009
  3. timm
    Replies:
    1
    Views:
    168
  4. penny
    Replies:
    28
    Views:
    3,073
    Charlton Wilbur
    Mar 10, 2008
  5. BlackHelicopter
    Replies:
    0
    Views:
    620
    BlackHelicopter
    Jan 31, 2013
Loading...

Share This Page