Author Topic: is this a bug in V1.49.809  (Read 396 times)

Offline false007

  • Newbie
  • *
  • Posts: 33
  • Karma: +0/-0
    • View Profile
is this a bug in V1.49.809
« on: May 09, 2011, 04:27:51 am »
Quote
18,brook2008,1
19,zjyxcyzly,1
20,pigtail,1
21,tolank,1
22,anbanana20073,1
23,lskl8,1
24,sellfish,1

I use the pattern :(^\d+\,)(?=.), and I can't replace the pattern,   but I can do the same thing in Emeditor.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 774
  • Karma: +6/-0
    • View Profile
Re: is this a bug in V1.49.809
« Reply #1 on: May 09, 2011, 07:00:57 am »
I use the pattern : (^\d+\,)(?=.), and I can't replace the pattern,   but I can do the same thing in Emeditor.

I can confirm that -if an positive Lookahead is used- we can't use the replace option.
It just doesn't replace the matched signs.

Find: (^\d+,)(?=t)
Replace: #

18,brook2008,1
19,zjyxcyzly,1
20,pigtail,1
21,tolank,1
22,anbanana20073,1
23,lskl8,1
24,sellfish,1


It should replace to

18,brook2008,1
19,zjyxcyzly,1
20,pigtail,1
#tolank,1
22,anbanana20073,1
23,lskl8,1
24,sellfish,1
- - -

At least the Positive Lookahead matching itself works fine.

(\d)(?=A)
A2Test
B3Test
C4Test
5ATest
6BTest
7CTest

- - -

BTW false007, you don't have to escape the coma:
(^\d+,)(?=.)
means: find one-or-more leading digits following by an coma, but only if there is followed any one single sign at least.


To have an workaround you could use
Find: (^\d+,)(.)
Repl: <your replacement>$2

.

Offline false007

  • Newbie
  • *
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: is this a bug in V1.49.809
« Reply #2 on: May 09, 2011, 07:16:57 am »
Quote
18,brook2008,1
19,zjyxcyzly,1
20,pigtail,1
21,tolank,1
22,anbanana20073,1
23,lskl8,1
24,sellfish,1

I want the result:
Quote
brook2008,1
zjyxcyzly,1
pigtail,1
tolank,1
anbanana20073,1
lskl8,1
sellfish,1

so I use the pattern:(^\d+\,)(?=.), and this pattern work well in Emeditor, and can't replace any thing in HE.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 774
  • Karma: +6/-0
    • View Profile
Re: is this a bug in V1.49.809
« Reply #3 on: May 09, 2011, 08:02:48 am »
I want the result:
so I use the pattern:(^\d+\,)(?=.), and this pattern work well in Emeditor, and can't replace any thing in HE.
Thanks for the example.
So just use:

Find:  ^\d+,
Replace:
[X] Regular Expression


No need to use Positive Lookahead here at all  ;)


You would only need this in this example to NOT remove "19," and "21," too:
18,brook2008,1
19,
20,pigtail,1
21,
22,anbanana20073,1

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1712
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: is this a bug in V1.49.809
« Reply #4 on: May 09, 2011, 01:19:14 pm »
Hi false007,

yes, this is a bug of 1.49.809 and all previous releases :).
I will fix this next beta (or release of 1.49, I am planning to release it, depends on amount of bug reports I will get).
Until than, just use Stephan's suggestion - it works as good as your original one :)

BR, Alex.

Offline false007

  • Newbie
  • *
  • Posts: 33
  • Karma: +0/-0
    • View Profile
Re: is this a bug in V1.49.809
« Reply #5 on: May 10, 2011, 02:16:16 am »
thanks :D :D :D :D :D :P :P :P :P :P :P

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1712
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: is this a bug in V1.49.809
« Reply #6 on: May 13, 2011, 12:29:29 am »
Hi false007,

I think, need to disappoint you :/ I have check the code, and this is a definitely a bug, but fix is not trivial and at the end will be one more hack to make this explicit scenario working.
The reason is generic HE search engine, which is same for plain and regexp search. It was initially a wrong architectural decision to do it in a such way, and there were already several problems with it as example greedy search or multi line search with not explicitly explorable line count...
I need to redesign the search engine (not regexp it works fine, problems are on HE side)  and do not think this is a good idea to do it in 1.49 version. It is too risky.
I will do this in 1.50, when scripting finished, before starting online functionality. 

Until then you can use Stefans workaround or use another editor for this purpose :/.
I need to confirm this (look ahead/behind usage for regular expression based replace) as current limitation.

Sorry for this, but I think this is a right decision.

BR, Alex