Problems with simple regexps . . .

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Ben

Problems with simple regexps . . .

Post by Ben »

I'm looking for a more capable replacement for EditPad, that won't choke on
multi-megabyte log files, and that can be used as a backup HTML editor,
when I just can't tolerate HomeSite's resource hogging, memory leaking,
ways any longer.

I just downloaded the evaluation version 4.4.1 of TextPad, and have
run into some wierd results with regexps:

= If I search [F5] for "/n", TextPad finds them just fine.
= If I attempt to replace "/n" with "#" (mentioned on your site) nothing
at all happens.
= If I search [F5] for "[:space:]+" in the following text,
"return [return]", TextPad successively highlights
each "e". In the line, "help [help]", it highlights each
"e" AND each "p" singly.

Can you enlighten me as to what I'm doing wrong?

Ben

running Win98SE/700mHzAthlon/384Mbyte
Roy Beatty

Re: Problems with simple regexps . . .

Post by Roy Beatty »

Ben,

Here's a quick reply:

a) Do you mean that you are finding on "\n" (backslash) rather than "/n" (slash)?

b) If you didn't, then try "\n" (b-slash).

c) To quote from TextPad help "How to Use Regular Expressions":
For example, [a-z0-9] is equivalent to [[:lower:][:digit:]]. (Note the extra pairs of brackets.)

That means that [[:character classes:]] must be enclosed in a second pair of brackets in order to take effect. So in your example, above, finding on "[:space:]+" will operate as if you had entered "[capes:]+".

In any case, welcome to TextPad, the finest text *editor* UI yet invented, IMHO. Its implementation of REGEX is more robust and stable than what I've seen in other editors. Hundreds of user-contributed add-ons demonstrate the synergy of this community and of the flexibility of this tool. And you'll find this forum to be a helpful and friendly resource as you explore TextPad. I have always felt satisfied for buying my licence. It's become for me a long-term extension of *my* capabilities.

God, did I write that florid prose? Well, my only interest in it is as a very satisfied customer.

Good luck,

Roy Beatty
Jeff Epstein

Re: Problems with simple regexps . . .

Post by Jeff Epstein »

Phew! I was writing my reply when Roy stepped in with the answers!

Ok then... :' )

Hope this answered your questions, Ben.


Jeff
http://www.jeffyjeffy.com/textpad
Post Reply