Page 1 of 1

A curious behavioral change with ^ and Replace in TP 7.x

Posted: Mon May 06, 2013 8:42 pm
by kengrubb
I am running TP 7.0.7

If I do this RE Replace, it trims off the last two characters in every line, as I had intended.
Find what: ..$
Replace with:
However, if I do this RE Replace, it trims off the first two characters in every line, and then repeats for that line until the condition is no longer true--either one or zero characters remain on the line.
Find what: ^..
Replace with:
This is not what I intended. I wanted to trim the first two characters from every line, and this RE Replace works, but it seems too pedantic and process intensive. Is there an easier Perlish way for this TP POSIX educated RE nut to accomplish this goal?
Find what: ^..(.*)$
Replace with: $1

Posted: Tue May 07, 2013 10:55 am
by ben_josephs
Confirmed. After removing the first two characters of a line, what were the third and fourth characters are now at the beginning of the line, so the regex matches them. In a certain over-literal sense, TextPad is doing what you asked it to do.

However, this is hardly intuitive, it isn't what TextPad 6 (and some other well-known editors) do, and it isn't what most users would expect it to do.

Posted: Wed May 08, 2013 12:45 pm
by bbadmin
We'll fix this in the next release. Thanks for reporting it.