ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

WildOpal - hypothetical new idea for a "find and replace" program

(1/7) > >>

Twinbee:
I wanted to do a simple 'find and replace' in Notepad++, and found out that it can only support simple WYSIWYG queries or over-complicated Regex statements which can sometimes feel like using a sledgehammer to crack a nut. After some frustration going down that road, I decided to think about how a "find and replace" feature should work, at least for 99% of purposes. I wanted something elegant and simple, yet clear and relatively powerful. I wanted NOT to worry about escaping special characters, yet I didn't want to lose the power that would usually provide or the efficiency of using the keyboard.

Colour coding, multiple lines, dual/split display, and on-the-fly updating come as standard (as per my other program Opalcalc ;).

This is what I've come up with so far. It's not a working program yet. I wanted to see if there was much interest in developing this further, and maybe even there's something already out there similar as I'm not overly keen on reinventing the wheel.



The unique unicode-flavoured characters offer numerous advantages over typical Regex/Extended syntax queries which rely on existing symbols:

1: It's clearer to formulate expressions and see what you're searching for, and whether certain characters are supposed to be 'special' or 'not'.

2: It's clearer for someone who has to read the expression and who had no idea what you were trying to do.

3: No worry about having to escape characters which may otherwise interpret normal text as 'special' commands. In comparison, with Regex, you may need worry about escaping more than ten different symbols over a text file!

4: Expressions can be reused for different texts without worrying about escaping anything in those texts.

5: Each symbol is easier to commit to memory, so the learning curve is greatly shortened.

Function keys are used for the special characters, so no speed is lost if you're only typing.

I've been pretty frustrated with how cumbersome and arcane the syntax can appear when formulating Regex queries. I hope many of you appreciate the advantages such an approach would provide. By all means, I'd be interested to hear any tweaks or additions to the general concept if you can think of anything! What kind of programs come closest?

MilesAhead:
Is there a symbol for the found pattern that may be used in the replacement?  For instance if I wanted to change every instance of

for (i=number;i<othernumber;i++)
{

to

for (i=number;i<othernumber;i++)
{
   int x = 0;

It seems inserting matched pattern as part of the replacement is fairly rare in windows editors without resorting to regex

wraith808:
I've been pretty frustrated with how cumbersome and arcane the syntax can appear when formulating Regex queries. I hope many of you appreciate the advantages such an approach would provide. By all means, I'd be interested to hear any tweaks or additions to the general concept if you can think of anything! What kind of programs come closest?
-Twinbee (May 24, 2015, 11:38 AM)
--- End quote ---

Though Regex can seem arcane, it's just because there are a lot of options, and it can do quite a bit.

There are a few programs that help with the formulation of regex queries.

regexbuddy helps more with learning, while regexmagic is the alternative if you just want to make them.  Expresso is a free alternative.  It seems like something along those lines might be a good thing to work on- something to teach in a simplified way without all of the additions, sort of like what you have mocked up, would be a good thing to have, rather than inventing the wheel.

But that's just my take on it.  I was in a similar place to you a while ago, and regexbuddy helped me turn that around.  Because RegEx support is everywhere, and it opened up a whole world for me to utilize it.  It helped that I *had* to learn for work, but I'd recommend that in any case.

Ath:
+1 plea for regexes.

www.regex101.com is a quick online site that  gives a full explanation on the regex and it's results, and has a replace feature as well  :up:

Twinbee:
MilesAhead: Yes, the "Group" button to allow pseudo-'variables' in the 'Replace' section should handle that in my hypothetical program.

Navigation

[0] Message Index

[#] Next page

Go to full version