AP OPIM - String operation/function in OPIM expression

We place out-of-spec components in a seperated spec database file. However, we don't want to see spec break in ISO between regular spec and oos spec. I tried to use string replace function on IE_SPEC attribute, but it did not work and also caused errors while generating ISO. How can I write an expression for spec value?

Thanks,

Maggie