http://qs1969.pair.com?node_id=81881

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This seems like it should be easy to do, but I haven't mustered the intellectual capital to get it done gracefully without a brute-force procedural approach. Can't this be done with regexps?

I need to swap the {x}th and all succeeding occurences of a given character within a string. Example: if x is 3 and the character "e" should be replaced by "1", then:
"Terence and Philip are sweet"
Should be changed to:
"Terenc1 and Philip ar1 sw11t".
Any help will be gratefully received.

Thanks, -Standfast.