Author Topic: Find&Replace Paste Regular Expression; Syntax Highlighting  (Read 142 times)

Offline kassiop

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Find&Replace Paste Regular Expression; Syntax Highlighting
« on: January 20, 2012, 06:56:16 pm »
Hi!

Thank you for great program!

1.   Bug?
When I paste regular expression in Find/Replace dialog HE add extra “\” in pasted text. Even if it is feature what method to disable it and simple paste regular expression?

P.S. In build 1.49.829 effect is not permanent. But at first/second time with large expression it exists.

Example: search day-channels string in TV-Program format City Cat:

^((ПОНЕДЕЛЬНИК|ВТОРНИК|СРЕДА|ЧЕТВЕРГ|ПЯТНИЦА|СУББОТА|ВОСКРЕСЕНЬЕ)\.?\s?\d\d?\s?(января|февраля|марта|апреля|мая|июня|июля|августа|сентября|октября|ноября|декабря).*\S)\s*+$
 
2.   Syntax Highlighting.
It is very important and “thin” tool, it had to be very properly and individual configured.
Your Editor (like Notepad++) IMHO realize it too hard for user.
User need to learn syntax of highlighting, edit, relaunch HE, see result…

I suppose to look at IMHO the best solution for subj – SynPlus plugin lister for Total Commander:
It has interactive interface for edit highlighting (in context menu) where user can easy add new keywords, ranges, rules and instant see result. It allow simply copy and reuse existing parts of highlighting.
Customizing best effective ever – many details to config – simple realization!

Example: I simply add new type of comment in “ini” file syntax –“;<space> Describe”, opposite standard – “;Disabled setting”

Offline Arthur

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • View Profile
    • My Blog
Re: Find&Replace Paste Regular Expression; Syntax Highlighting
« Reply #1 on: January 21, 2012, 12:35:02 am »
I used ^((ПОНЕДЕЛЬНИК|ВТОРНИК|СРЕДА|ЧЕТВЕРГ|ПЯТНИЦА|СУББОТА|ВОСКРЕСЕНЬЕ)\.?\s?\d\d?\s?(января|февраля|марта|апреля|мая|июня|июля|августа|сентября|октября|ноября|декабря).*\S)\s*+$ in HE 1.50 it did not append any "\".
Well, what happens if you highlight the RegEx and then bring up the Search/Replace dialog?
Ales, btw, I have a wish (if not already told you) the Find Dialod should be sizable, it is really hard to digest the RegEx text in the dialog.
Kassiop: an image worth 1000 words somebody said, can you make one up for us to see the issue pozaluista?
Re #2: You learn it once and benefit for life (like in the bible about the fish), after all every editor is different. Besides, I suggested Alex to create a tool or utility to build/edit generate the Syntax files right from HE.

Offline kassiop

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Find&Replace Paste Regular Expression; Syntax Highlighting
« Reply #2 on: January 21, 2012, 02:22:04 am »
1.   I don’t have version 1.50. Let talk version from Downloads. I catch bug in version 1.49 from end of 2011. Before I post I install 1.49 from 2012 and see the bug, but not permanent (may be I forgot some details to repeat). By the way, distinguish versions by build without Build in Downloads is very inconvenient.
2.   Repeat:
Paste Reg Ex to Notepad
and insert line break in the middle of Reg Ex    ; for constant repeat
Select Text
Copy to Clipboard
Open HE
Press Ctrl+H
Check Regular Expression
Paste Text
See “\” before any special symbol





3.   Syntax Highlighting.
I don’t compare editors. I suppose to see how it realized (UI) (1min with downloading), understand how little work to clone it.
(If you want, you can appreciate how artfully and effective it realized as programmer!)
My constructive message is what Highlighting in SynPlus is 100% satisfy me.
Note, it is Plugin, not serious Editor!
« Last Edit: January 21, 2012, 02:32:22 am by kassiop »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1712
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Find&Replace Paste Regular Expression; Syntax Highlighting
« Reply #3 on: January 21, 2012, 05:40:25 am »
Hello Kassiop,

welcome on forum.

1) http://forum.hippoedit.com/beta-version-test/alpha-1-50/

2) this not a bug. HE works as designed here.
This happens only if you have unescaped line break in text you paste in. Normally you do not have multi-line regular expression (or what you expect?), but it often happens, that user want to search multi line text.
So, to make life of the user easier, pasted multi line text, converted to regexp, line breaks converted to regexp notation and regular expression flag is automatically set. Because of such automatic conversion to regular expression, all regexp reserved symbols in pasted text are also escaped, to avoid unexpected result.

3) Probably not more than 1% of the users really create new schemas or edit existing. And as Arthur mentioned (he has already requested such functionality) after some time you will become familiar with a syntax, and it will be easier to change/create schemes directly, as xml files. In addition to this syntax definition for HE is rather complex (I think more complicated as for SynEdit) and continuously developed. 
The effort for creating of such UI managing functionality will be significant (months), and it will require continuous support, as new features will be added/changed in definitions.
So, I have decided to spent time on features, that are more requested and will make happier more users ;). But if you would like to help here, I will help you with a pleasure ;)
About SynPlus - guys have only wrapped synedit, and do not develop text editor by themselves, so they have enough resources to write a syntax wizards. And as I said, syntax of SynEdit files are much simple as in HE. And syntax is not developed any more (last version of synedit from 2007).

Offline kassiop

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Find&Replace Paste Regular Expression; Syntax Highlighting
« Reply #4 on: January 21, 2012, 07:02:39 am »
2.   I have understood.
But I want to note, what such behavior is quite unclear at first time.
I didn’t see information about it in help.
User can simply Copy extra empty lines while coping, he don’t mean multiline search (as I did).
May be such conversion need short confirmation by user (at first time)?

No problems (for me from this point on time  :) ).
Thank you for attention.

P.S. Highlighting
I agree “Probably not more than 1% of the users really create new schemas”.
But even get new color to subrange of existing keywords – for programmers is much more real and often and convenient.
« Last Edit: January 21, 2012, 02:42:32 pm by kassiop »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1712
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Find&Replace Paste Regular Expression; Syntax Highlighting
« Reply #5 on: January 21, 2012, 06:37:41 pm »
I will evaluate adding of such one time information message for 1.50. Can be helpful.

According to modification of the schema - it is much faster to copy existing style definition, rename it and delete unwanted keywords directly in xml file, than to do the same with help of any UI.
Nevertheless, I stay wit my opinion, there are other features I can spent my time and they will be more useful for all. For this feature, I currently do not have resources.

 

Related Topics

  Subject / Started by Replies Last post
6 Replies
1396 Views
Last post January 31, 2009, 10:03:18 pm
by alex
10 Replies
1895 Views
Last post June 30, 2010, 07:58:52 am
by Stefan
3 Replies
650 Views
Last post January 22, 2009, 03:40:27 pm
by Stefan
3 Replies
937 Views
Last post February 03, 2009, 10:08:20 pm
by Stefan
6 Replies
273 Views
Last post January 21, 2012, 03:26:37 am
by alex