# Regex in find or find and replace

**URL:** https://discourse.processing.org/t/regex-in-find-or-find-and-replace/14277
**Category:** Development
**Created:** [September 29, 2019, 1:25pm UTC](https://discourse.processing.org/t/regex-in-find-or-find-and-replace/14277 "2019-09-29T13:25:38Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![biran4454](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@biran4454](https://discourse.processing.org/u/biran4454)
#### Post date: [September 29, 2019, 1:25pm UTC](https://discourse.processing.org/t/regex-in-find-or-find-and-replace/14277/1 "2019-09-29T13:25:38Z")

</div>

Hi there!  
I just was using your brilliant piece of software, and thought it would be amazing to be able to use **regular expressions** in find or **find and replace**.  
How feasible is this?  
Thanks!!  
Biran4454

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [October 2, 2019, 2:53pm UTC](https://discourse.processing.org/t/regex-in-find-or-find-and-replace/14277/2 "2019-10-02T14:53:21Z")

</div>

I am assuming that you mean using regular expressions in the PDE desktop editor – not the p5.js web editor (and not using regular expressions in a running program–you said Find and Replace). Is that right?

---

<div class="post-metadata">

### Author: ![biran4454](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@biran4454](https://discourse.processing.org/u/biran4454)
#### Post date: [October 8, 2019, 5:29pm UTC](https://discourse.processing.org/t/regex-in-find-or-find-and-replace/14277/3 "2019-10-08T17:29:47Z")

</div>

Yeah, sorry my question wasn’t clear enough.

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [October 9, 2019, 1:57am UTC](https://discourse.processing.org/t/regex-in-find-or-find-and-replace/14277/4 "2019-10-09T01:57:05Z")

</div>

It is a nice idea. You can open an issue with a feature on github (if one doesn’t already exist).

However I should warn you that in general PDE is not adding these kinds of advanced features – it has a small set of core developers, and is attempting to maintain the existing software features for beginners rather than make the software more complicated.

Very old related issue: [https://github.com/processing/processing/issues/63](https://github.com/processing/processing/issues/63)

One option in the meantime is to install a Processing extension / plug-in in Visual Code Studio, Atom, Sublime, or Textmate. Then you can use their built-in regex, code folding, etc.

---

<div class="post-metadata">

### Author: ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)
#### Post date: [October 9, 2019, 2:38am UTC](https://discourse.processing.org/t/regex-in-find-or-find-and-replace/14277/5 "2019-10-09T02:38:07Z")

</div>

in PDE use find and show usage

 ![PDE_find_showUsage](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/e/e8efc2e72e07542e66ea343147239c1d9e9d71cf.png)

or just in special cases use a other editor ( here try npp )  
[https://npp-user-manual.org/docs/searching/#regular-expressions](https://npp-user-manual.org/docs/searching/#regular-expressions)

 ![NPpp_findRegex](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/e/e7c06411f71e4d30e777ab91e541c179f58b4370.png)

but somehow i miss where ( related to my used variable names ) i would need REGEX?  
even less regarding processing/java language words ?

please show us your example.

---

<div class="post-metadata">

### Author: ![biran4454](https://avatars.discourse-cdn.com/v4/letter/b/9dc877/32.png) [@biran4454](https://discourse.processing.org/u/biran4454)
#### Post date: [October 19, 2019, 1:38pm UTC](https://discourse.processing.org/t/regex-in-find-or-find-and-replace/14277/6 "2019-10-19T13:38:39Z")

</div>

My particular case is that I wanted to replace a lot of variable assignments that set the variable (to a number) with a different thing, but not the assignments that set the variable to a letter. That is just one example of where it would be a great help, as one could just do:  
`myVar = \d`  
or maybe one would want to replace variable assignments that set the variable to a three digit number:  
`myVar = \d{3}`

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [October 19, 2019, 2:14pm UTC](https://discourse.processing.org/t/regex-in-find-or-find-and-replace/14277/7 "2019-10-19T14:14:33Z")

</div>

If you wish to use another editor only for the occasional regex edit (for example, I often use TextMate for regex on Mac), keep in mind that you should close the sketch in Processing first so that PDE doesn’t if ignore / overwrite changes from the other editor.
