M
Mahesha
Hello,
I need help in replacing one string pattern with another.
Ex: I have a financial security expression like
log(T 3.25 6/24/2004)/sqrt(T 4.5 6/19/2002)
Here "T 3.25 6/24/2004" is a variable on which I need to perform log
and then divide the result with 3.980. While parsing such expressions,
I need to find all occurence of date values and replace "/" character
with "~" character. I need to do this only for date portion of the
expression and not for divison operator.
After the transformation , this expression should be
log(T 3.25 6~24~2004)/sqrt(T 4.5 6~19~2002)
I was looking at replace method of regex object. But this doesn't
provide replacing one pattern with another pattern. I mean I'm not
able to figure out a way to find a date and replace all "/" characters
of the date with "~".
Regards,
Mahesha
I need help in replacing one string pattern with another.
Ex: I have a financial security expression like
log(T 3.25 6/24/2004)/sqrt(T 4.5 6/19/2002)
Here "T 3.25 6/24/2004" is a variable on which I need to perform log
and then divide the result with 3.980. While parsing such expressions,
I need to find all occurence of date values and replace "/" character
with "~" character. I need to do this only for date portion of the
expression and not for divison operator.
After the transformation , this expression should be
log(T 3.25 6~24~2004)/sqrt(T 4.5 6~19~2002)
I was looking at replace method of regex object. But this doesn't
provide replacing one pattern with another pattern. I mean I'm not
able to figure out a way to find a date and replace all "/" characters
of the date with "~".
Regards,
Mahesha