# Help with how to edit OLD code

**URL:** <https://discourse.nodered.org/t/help-with-how-to-edit-old-code/95781>\
**Category:** General\
**Created:** [4 March 2025 10:08 UTC](https://discourse.nodered.org/t/help-with-how-to-edit-old-code/95781 "2025-03-04T10:08:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [4 March 2025 10:08 UTC](https://discourse.nodered.org/t/help-with-how-to-edit-old-code/95781/1 "2025-03-04T10:08:13Z")

</div>

I'm going through editing/updating some OLD code.

Alas I was using `var` rather than `let` and I would like to change them all from `var` to `let`.

But as I've found the `search/replace` is a bit ..... _wobbly_.

If I search simply for `var` it finds all matches like `variable`.... which sometimes is needed to be left alone.

I've tried `var ` (note the spave at the end) but that doesn't seem to work either.

Any _tricks_ I've missed?

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [4 March 2025 10:28 UTC](https://discourse.nodered.org/t/help-with-how-to-edit-old-code/95781/2 "2025-03-04T10:28:40Z")

</div>

> [@Trying\_to\_learn](#):
>
> I've tried `var ` (note the spave at the end) but that doesn't seem to work either.

That works for me, variable will not match var with a space ?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [4 March 2025 10:29 UTC](https://discourse.nodered.org/t/help-with-how-to-edit-old-code/95781/3 "2025-03-04T10:29:33Z")

</div>

_Sod's law_

It now works.

Sorry.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [4 March 2025 10:30 UTC](https://discourse.nodered.org/t/help-with-how-to-edit-old-code/95781/4 "2025-03-04T10:30:19Z")

</div>

(Side note)

Still on `solved` button visible.

 ![Screenshot from 2025-03-04 21-30-31](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/6/567eb855a198a29f272f82581922ba13d917e303.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 March 2025 10:31 UTC](https://discourse.nodered.org/t/help-with-how-to-edit-old-code/95781/5 "2025-03-18T10:31:16Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
