Preserving case for search / replace in CM6

Does anyone know if there is a way to preserve case for all the matches to be replaced?
Currently I’m using custom search panel with replaceAll, replaceNext helpers.

Example (case insensitive search):
abc - search query
def - replace query
const str = 'Abc' - code string

Expected result after replacing:
const str = 'Def'

No, that’s not something that is supported. It seems like it would get very messy to get all the corner cases to magically do the right thing.

Of course, if you use a custom search panel you can run whatever code you want on the replace action.

Got it. Thanks for response