# Auto replace with "\_" in object name

**URL:** <https://forums.toadworld.com/t/auto-replace-with-in-object-name/53185>\
**Category:** Toad for Oracle & DevOps Toolkit\
**Created:** [July 8, 2021, 5:21pm UTC](https://forums.toadworld.com/t/auto-replace-with-in-object-name/53185 "2021-07-08T17:21:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddjen11](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@ddjen11](https://forums.toadworld.com/u/ddjen11)\
**Post date:** [July 8, 2021, 5:21pm UTC](https://forums.toadworld.com/t/auto-replace-with-in-object-name/53185/1 "2021-07-08T17:21:26Z")

</div>

did not find a similar discussion for this:  
we have a lot of objects with "\_" (underscore) embedded in name, for ex: "due\_dt". Based on a value of 'dt=drop table', it expanded to "due\_drop table" ,can this be bypassed? I think earlier Toad did not do so?

I know the Case Sensitive option, but I'll have to remember it when typing the names, is there an easier way?

---

<div class="post-metadata">

**Author:** ![Gary.Jerep](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/gary.jerep/32/205_2.png) [@Gary.Jerep](https://forums.toadworld.com/u/Gary.Jerep)\
**Post date:** [July 8, 2021, 6:53pm UTC](https://forums.toadworld.com/t/auto-replace-with-in-object-name/53185/2 "2021-07-08T18:53:51Z")

</div>

Earlier Toad versions would probably have behaved the same way here, although I would need one of the Devs to confirm. Ideally, I think the ultimate fix here is an enhancement that allows different activation characters to be defined for different auto-replace strings.

Short of messing with the Activation Characters for better control (snap 1 below) another option is to define your shortcuts via Code Templates (snap 2 below). For example, I created a "dt" entry in the Templates library, as shown (and got rid of the "dt" entry in AutoReplace library). Whenever I want "dt" to be replaced by "drop table" I just hit Ctl- after "dt" to trigger the replacement.

Hope this gives you some more ideas to ponder.

 ![image](https://global.discourse-cdn.com/quest/original/2X/e/ec0ef15710a969cdb5b7876e20848afb3f341eb9.png)

 ![image](https://global.discourse-cdn.com/quest/original/2X/b/b0e7c63b372add3b832114940176647a22d6fce7.png)

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [July 9, 2021, 4:16pm UTC](https://forums.toadworld.com/t/auto-replace-with-in-object-name/53185/3 "2021-07-09T16:16:45Z")

</div>

I'd say this is a bug.

In Options -\> Editor -\> Behavior, there is a setting for Additional Word Chars. Underscore is the default value there. By having that set, we should not replace the dt in due\_dt. I'll fix this for the next version.

---

<div class="post-metadata">

**Author:** ![ddjen11](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@ddjen11](https://forums.toadworld.com/u/ddjen11)\
**Post date:** [July 9, 2021, 4:37pm UTC](https://forums.toadworld.com/t/auto-replace-with-in-object-name/53185/4 "2021-07-09T16:37:06Z")

</div>

Thanks. Templates is great option & can work here, but I typically use templates for more complex expressions that saved me a ton of typing.

---

<div class="post-metadata">

**Author:** ![ddjen11](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@ddjen11](https://forums.toadworld.com/u/ddjen11)\
**Post date:** [July 9, 2021, 4:48pm UTC](https://forums.toadworld.com/t/auto-replace-with-in-object-name/53185/5 "2021-07-09T16:48:51Z")

</div>

Thanks looking forward to the fix in the next version. Any chance maybe a patch to v13?

Just to clarify my understanding about AR:

**Additional Word Chars** - isn't that for triggering auto replace after an expression? For ex: I type "dt" + **"\_"** then it expands the string. Not sure if it's relevant here, as we are trying to prevent if from expanding the expression: "due\_dt". Typically space will expand it which we don't want.

---

<div class="post-metadata">

**Author:** ![JohnDorlon](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/johndorlon/32/9997_2.png) [@JohnDorlon](https://forums.toadworld.com/u/JohnDorlon)\
**Post date:** [July 9, 2021, 5:00pm UTC](https://forums.toadworld.com/t/auto-replace-with-in-object-name/53185/6 "2021-07-09T17:00:12Z")

</div>

Sorry, we only make patches for major bugs, and even in that case, only the most recent version.

To see "Additional Word Chars" in action, try this:

1. leave it set to an underscore.
2. type under\_score in the editor and double-click anywhere in the word. The whole word is selected.
3. Clear out the Additional Word Chars setting.
4. Repeat step 2. Now, the selection stops where the underscore character is.

So, with Additional Word Chars set to underscore, due\_dt should never trigger autoreplace for dt (but it does, so that's a bug). We should see "due\_dt" as 1 word, not 2 words separated by an underscore.

Options -\> Editor -\> Auto Replace -\> Activation Characters are different. This refers to the characters that you can type AFTER "dt" (besides whitespace) to turn it into "drop table" So, notice parenthesis are in there. You could type "dt(" to turn into "drop table(". If you take the parenthesis out of this setting then "dt(" will remain unchanged.

---

<div class="post-metadata">

**Author:** ![ddjen11](https://avatars.discourse-cdn.com/v4/letter/d/45deac/32.png) [@ddjen11](https://forums.toadworld.com/u/ddjen11)\
**Post date:** [July 9, 2021, 5:25pm UTC](https://forums.toadworld.com/t/auto-replace-with-in-object-name/53185/7 "2021-07-09T17:25:28Z")

</div>

ok got it thanks, i was mixing it up. Yes it was the 1st char in the set & working well for word selection, just not for auto replace.
