Re: Strange Bug in Search and Replace (regular expressions)...
- I've been able to duplicate and verify this behavior as well. There
are other RegExp problems involving NoteTab, for example not all
Shorthand Character Classes work the way they should.
It's been quite awhile ago but I seem to recall Eric saying something
about the less than perfect RegExp engine NoteTab uses. That it's
not a NoteTab coded thing, rather NoteTab uses an outside 3rd party
It also sticks in my craw that Eric said he is looking at using a
much better RegExp engine in version 5 which we're all anxiously
--- In email@example.com, Steve <slamb@t...> wrote:
> Hi ntb-clips,
> I've found what I think is a unusual bug in search
> and replace (with regular expressions). I'm hoping that
> Fookes will be able to check this out--also wondering if
> anyone has used regular expressions extensively in
> NoteTab Pro (via Clips), and whether they've had success
> with the feature.
> The problem/bug:
> Use the following search string (as a 'Clip'):
> ^!Replace "\s[\s]+" >> "WHATPLOT" WRA
> It means replace 2 or more spaces (\s) with the string
> I've uploaded sample data that demonstrates the bug
> The file name is "bug_data_sparse.txt".
> The file is 33 bytes long, with 2 lines. The first line
> contains 4 spaces, followed by the string "Hidden Excluded".
> The second line contains 12 spaces, and that is all.
> Removing one space character from line two causes the
> Replace function to work correctly. Doing a Replace on
> the file without modification, produces a result of
> "WHATPLOTPLOTen Excluded" in the first line, which has
> obliterated the "Hidd" part of "Hidden".
> It's strange because removing just one space from
> the file makes things OK.
> It's bad because the bug is _not_ specific to
> these 33 bytes. In fact, it took a lot of narrowing
> down of the original data file to get it to these few bytes.
> P.S. Overall, NoteTab Pro seems to be a terrific product!!!