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

Re^4: substitution in regular experssion

by aeqr (Novice)
on Apr 23, 2014 at 20:21 UTC ( [id://1083444]=note: print w/replies, xml ) Need Help??


in reply to Re^3: substitution in regular experssion
in thread substitution in regular expression

Sorry I made a mistake, yes it works indeed thanks. I wanted to do it without the while in order to train myself to use the global option and in order to do it in one line. Maybe not very useful but in my assignment it is recommended to find short solutions.
  • Comment on Re^4: substitution in regular experssion

Replies are listed 'Best First'.
Re^5: substitution in regular experssion
by AnomalousMonk (Archbishop) on Apr 23, 2014 at 20:34 UTC
    ... in my assignment ...

    Changing your posts without citation and not being up-front about posting homework questions is a good way to earn lotsa down-votes. Good luck in your studies, and remember that teachers nowadays have lots of sneaky ways to discover sneaky students sneaking answers off of the Interwebs.

      It is not a assignment we have to hand in, it is an optional task and the coding language is free to choose. But anyway, thanks for trying to help and for the nice comments.

        I'd say AnomalousMonk did more than "trying" by giving you the key to your solution here ;-)

        A reply falls below the community's threshold of quality. You may see it by logging in.
Re^5: substitution in regular experssion
by Anonymous Monk on Apr 23, 2014 at 20:30 UTC

    Okay, that's a legitimate reason, although it's considered polite to let people know that you're asking for assignment help in the original post.

    AnomalousMonk has shown a way to do it in one line, although that solution doesn't modify the string.

    If you want to evaluate code on the right-hand side of your search/replace regular expression, see the /e modifier in perlop.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-20 00:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found