Author Topic: [Solved] RegEx find escaped MetaChars  (Read 797 times)

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 774
  • Karma: +6/-0
    • View Profile
[Solved] RegEx find escaped MetaChars
« on: March 11, 2009, 08:37:59 am »
I try to search for text =>  \n
and replace this by \n (new line)

Since \n is an sign of RegEx  i escaped the meaning by adding an leading  backslash => \\n

[X] RegEx is ticked.
But HE says it didn't find \\n  while HE should search for \n.
(see pic)

Am i wrong?
« Last Edit: April 11, 2009, 12:23:11 pm by Stefan »
Stefan, HippoEDIT beta tester  (HippoEDIT News On Twitter: http://twitter.com/hippoedit/)

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1712
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: RegEx find escaped MetaChars
« Reply #1 on: March 11, 2009, 02:18:51 pm »
Hello Stefan,

no, you are right...
It is a bug. Once more related for the multiline search..

I would fix it next version.

Offline Arthur

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • View Profile
    • My Blog
Re: RegEx find escaped MetaChars
« Reply #2 on: March 11, 2009, 08:15:53 pm »
You know, I think I better add to this post:

I also did some extensive searches today on a huge log file and used the Regular Expression mechanism.

I was about to construct my search criteria and clicked on Zero or One ( the ? mark) using the GUI (Ctrl-F, right arrow on the right off the Find What text box and chose it from the small pop-up window).
At this point the ? sign was not inserted into the Find What text box, but others seem like do (did not try every single one).

I also have spotted that: sometimes the search symbols get appended and sometimes just get in-between.

I think both things are bugs.

PS: Play around there by highlighting the search pattern, etc.

Sorry if my explanations are incomplete, need to run,
thanks

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 774
  • Karma: +6/-0
    • View Profile
Re: RegEx find escaped MetaChars
« Reply #3 on: March 12, 2009, 06:37:03 am »
632
RegEx search \\n replace by \n works
RegEx search \\n replace by \\n\n works too

Just a note for they are curiously:  Issues found by Arthur are not investigated yet but noted, thanks.

Offline Arthur

  • Hero Member
  • *****
  • Posts: 624
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • View Profile
    • My Blog
Re: RegEx find escaped MetaChars
« Reply #4 on: March 12, 2009, 02:39:03 pm »
In addition to the above I have found that if one places any regex char (e.g. *) into the initially empty search box, adds text, then positions the cursor to the end of the typed in text (say the search criterion now becomes *test) and picks another regex char from the available patterns window, for example \s, the text in the Find What box becomes *tes\st - so it cuts into the word in-between, not good.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1712
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: RegEx find escaped MetaChars
« Reply #5 on: March 14, 2009, 12:06:44 pm »
Hi Arthur, can be... THere were some time ago problems like this.
With "?", I would check. Maybe some simple bug.
For wrong position reason is that edit field does not store position when focus is lost, so it is real problem to find where rto insert text when focus is on menu :) But I would try to solve this.

Thanks a lot for bug report.

Best regards,
Alex.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 774
  • Karma: +6/-0
    • View Profile
Re: RegEx find escaped MetaChars
« Reply #6 on: March 30, 2009, 08:08:40 am »
Beta 1.42 Build 637

Fixed. Problems with incorrect position of the cursor in Find What field, when inserting regexp tags from helper menu in Find dialog.

 

Related Topics

  Subject / Started by Replies Last post
5 Replies
1023 Views
Last post February 01, 2009, 01:31:11 pm
by Stefan
6 Replies
1042 Views
Last post April 03, 2009, 03:31:41 pm
by Arthur
2 Replies
554 Views
Last post April 08, 2009, 12:43:08 pm
by Stefan
4 Replies
628 Views
Last post April 24, 2009, 03:50:23 pm
by alex
1 Replies
515 Views
Last post August 31, 2009, 11:07:09 am
by alex