I have the following situation
Case 1:
Input: X(P)~AK,X(MV)~AK
Replaced by: AP
Conclusion: X(P)~AP,X(MV)~AP
Case 2:
Input: X(PH)~B$,X(PL)~B$,X(MV)~AP
Replace with :USD$
Conclusion: X(PH)~USD$,X(PL)~USD$,X(MV)~USD$
As you can understand, it is always replaced ~<string>.
Is it possible to achieve the same by regular expression?
Note: ~ During compilation, except for the structure, nothing will be known. Typical structure
looks like
X(<Variable Name>)~<Variable Name>
I am using C # 3.0
user372724
source
share