cancel
Showing results for 
Search instead for 
Did you mean: 

How to use pattern in replace function?

JunTan
Level 3
I capture a Text from command line output,I need replace all characters after '$',I tried following ways,but both not work. Replace([output], "\$.*", "\$") Replace([output], "\\$.*", "\\$") Can we use regular expression in the replace function? how to use? Thanks
2 REPLIES 2

John__Carter
Staff
Staff
The Replace function expects literal values, not wildcards or regex patterns, eg Replace(""Anything"", ""Any"", ""Some"") = ""Something"" You could try combining the Mid and InStr functions, eg Mid([MyText], InStr([MyText], ""$"") + 1, Len([MyText])) If you want to use a regular expression then you'll need to use a code stage.

Thanks