# Smart rule to replace text in name

**URL:** <https://discourse.devontechnologies.com/t/smart-rule-to-replace-text-in-name/55442>\
**Category:** Automation\
**Created:** [May 6, 2020, 5:22am UTC](https://discourse.devontechnologies.com/t/smart-rule-to-replace-text-in-name/55442 "2020-05-06T05:22:03Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [May 27, 2021, 1:48am UTC](https://discourse.devontechnologies.com/t/smart-rule-to-replace-text-in-name/55442/5 "2021-05-27T01:48:39Z")

</div>

> [@Jk12](#):
>
> Is it possible to change the name based on left/right/mid of the filename string?

You can use a regex for that.

Here’s a Smart Rule by @mhucka that shows how regex can be used:

 ![](https://devontech-discourse.s3.dualstack.us-east-1.amazonaws.com/uploads/original/3X/3/8/38714fb470a69c30d9ebc259fc3ff10ea0ea5007.jpeg)

See the `Scan Name` and `Change Name` actions at the bottom?

In these two posts he explains it

- [post that explains what the Smart Rule does](https://discourse.devontechnologies.com/t/moving-inbox-notes-to-specific-folders-in-my-db/64441/6)
- [post that explains the regex](https://discourse.devontechnologies.com/t/moving-inbox-notes-to-specific-folders-in-my-db/64441/9)

---

_[View the full topic](https://discourse.devontechnologies.com/t/smart-rule-to-replace-text-in-name/55442)._
