Regex in find or find and replace

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?

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?

Yeah, sorry my question wasn’t clear enough.

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:

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.

in PDE use find and show usage

or just in special cases use a other editor ( here try npp )

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.

1 Like

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}


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.