Implementation regexp Replacement String Conditionals
I would like to be able to change letters in words according to the register, for example
foo -> boo
Foo -> Boo
FOO -> BOO
This could be done as a regular expression if Replacement String Conditionals were supported https://www.regular-expressions.info/replaceconditional.html
Can you tell me how to make such replacements in the text?
Please sign in to leave a comment.
Hi there,
That can be done with normal (plain text) replacement right now. Will work for your sample text.
For that you just need to activate the "Preserve case" option in the Replace field.
You are correct, but I just simplified the example
I would like to be able to do the same for replacement when using regular expression.
Now this option is disabled when you enable regular replacement
https://youtrack.jetbrains.com/issue/IDEA-253964 -- no votes so far for 6 months.
That's the only reasonable match returned in my search: https://youtrack.jetbrains.com/issues/IDEA?q=regex%20%22preserve%20case%22 (IDEA project as it's an IDE-wide functionality/feature)