Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
What I must is:$string='III...MMMMMOOOO....MMMIIIII';
this can be done with ~s in a reg exp? Because I tried:III...MMMMMOOOO --> IIIIIIMMMMMOOOO OOOO....MMMIIIII --> OOOOOOOOMMMIIIII
and it printed:$string=~s/\.+M+i+/oMi/g;
Apparently i'm doing something wrong...III...MMMMMOOOOoMi
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to make these reg exp changes?
by keszler (Priest) on Nov 15, 2009 at 22:52 UTC | |
Re: How to make these reg exp changes?
by ikegami (Patriarch) on Nov 15, 2009 at 23:17 UTC | |
Re: How to make these reg exp changes?
by Anonymous Monk on Nov 15, 2009 at 22:43 UTC | |
by Anonymous Monk on Nov 15, 2009 at 22:51 UTC | |
Re: How to make these reg exp changes?
by Anonymous Monk on Nov 15, 2009 at 23:26 UTC | |
by ikegami (Patriarch) on Nov 15, 2009 at 23:39 UTC | |
by Anonymous Monk on Nov 16, 2009 at 00:09 UTC | |
by ikegami (Patriarch) on Nov 16, 2009 at 00:15 UTC | |
by Anonymous Monk on Nov 16, 2009 at 00:23 UTC | |
by ikegami (Patriarch) on Nov 16, 2009 at 01:28 UTC |