in reply to Re: Keeping track of substituted regions with a while loop
in thread [SOLVED] Keeping track of substituted regions with a while loop
Hi kschwab, thanks for your reply. You're absolutely right, that is another way of solving this problem (by sequentially appending the one-letter codes to a new string instead of substituting an existing string) and it is similar to the "alternative" method I described in my original post.
However, I was not looking so much into getting the right answer as rather trying to learn more about how to use regexes, combined with a while loop, in this situation. Is there an "easy" way for Perl to keep track of the position it is in, as it moves along a string in a while loop, or would that be an overkill to do, considering there are easier options available?
|
|---|