in reply to Specific substitution in regular expressions

substr( $line, index( $line, '99' ), 2 ) = $variable;
The 2 being the length of '99'.

Replies are listed 'Best First'.
Re^2: Specific substitution in regular expressions
by svenXY (Deacon) on Sep 17, 2008 at 09:55 UTC
    Hi,
    ++apl, works fine as long as the '99' the OP wants to replace is really the first occurence of '99' in the string.
    Regards,
    svenXY