in reply to Re^5: substitution in regular expression
in thread substitution in regular expression

Sorry for being unclear, I would like to do this the way I've shown(global matching or replacement and in one line). It doesn't matter if the string is modified or not. In my attempt, it is modified because of the way I am trying to do it.

But if you have a similar solution that doesn't modify the string, it's also fine.

  • Comment on Re^6: substitution in regular expression

Replies are listed 'Best First'.
Re^7: substitution in regular expression
by AnomalousMonk (Archbishop) on Apr 23, 2014 at 20:40 UTC
    It doesn't matter if the string is modified or not. ... a ... solution that doesn't modify the string, it's also fine.

    Please see Re: substitution in regular expression from half an hour ago.

      Yes I saw your solution, I am copying it in order to send it to my teacher so I can get an A.