PREV INDEX NEXT

Author: Stan Eisenstat
Subject: Re: [Cs323] regex understanding follow-up
Date: Wednesday, 14 Oct 2020, 11:22:58


    > Message Posted By: Unknown
    >
    > In the example you gave:
    >
    > "  % X=FOO /c/cs323/Hwk3/mcBash BAR
    >   (1)$ ${1}$X${1} "
    >
    >
    > So for the example you gave, would you first want to convert the first
    > ${1}, shift which index/char we are in the line, then call the regex again
    > and get $X, shift the index of the char in the line we are at again, and
    > then call the regex again to get the second ${1} in that order?

Yes, but instead of leaving the line in place and keeping
track of where to resume searching, I move the matched
and replaced part to the end of a different string.

--Stan-
PREV INDEX NEXT