一个replace顺序问题

【一个replace顺序问题】

一个replace顺序问题

文章插图
一个替换序列问题一个替换序列问题介绍:我想我有这样一个数列,其中有1 ^ 2 ^ 3这样的数,但也有一些带括号的数像()或(())[] 。我想用replace实现函数R,比如用2 ^ 3 ^ 4代替1 ^ 2 ^ 3 。