Case Sensitivity and Regular Expressions

General questions about using TextPad

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

Post Reply
BobF
Posts: 4
Joined: Sat Apr 24, 2004 10:25 am

Case Sensitivity and Regular Expressions

Post by BobF »

I've just discovered some behaviour in 4.7.3, reproduced in 4.7.2, that seems a little counterintuitive to me.

I load a text file and search, using regular expression syntax, for ^[A-Z]+-. The match case option is deselected.

So I want the search to find lines beginning, e.g., XYZ- or DEFGH-, but not anything else, e.g. only find lines beginning with a series of uppercase letters and a dash.

I find that the search only works if I enable the option to Match Case.

Does anyone know if this is the desired behaviour ? I would have though that Match Case should not apply to RE searches.
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Yes, this is working exactly as expected.

It saves having to enter such horrors as "[Hh][Ii][Ee][Rr][Oo][Gg][Ll][Yy][Pp][Hh][Ii][Cc][Ss]".

The ability to choose between case-sensitive and case-insensistive matching is supplied with most regular expression recognisers.
BobF
Posts: 4
Joined: Sat Apr 24, 2004 10:25 am

Post by BobF »

Interesting. OK, thanks.
Post Reply