General questions about using TextPad
Moderators: AmigoJack , bbadmin , helios , Bob Hansen , MudGuard
gcotterl
Posts: 252 Joined: Wed Mar 10, 2004 8:43 pm
Location: Riverside California USA
Post
by gcotterl » Mon Apr 23, 2012 9:27 pm
To find lines with a hyphen in position 97, I type:
^.{96}-
in the 'Find What' box, tick "Regular Expression" then click "Find All" but a dialog box is displayed saying "Cannot find regular expression: '^.{96}-'
(In the Preferences Edit menu. the "Use POSIX regular expression syntax" box is ticked).
Is there something "special" about searching for a hyphen?
ben_josephs
Posts: 2464 Joined: Sun Mar 02, 2003 9:22 pm
Post
by ben_josephs » Mon Apr 23, 2012 9:45 pm
No, there isn't. Hyphen is "special" only when enclosed in square brackets.
Are you sure the character position is correct? Are you sure it's a hyphen?
gcotterl
Posts: 252 Joined: Wed Mar 10, 2004 8:43 pm
Location: Riverside California USA
Post
by gcotterl » Mon Apr 23, 2012 10:12 pm
[b][size=18]CORRECTION[/size].[/b]
To find lines with a hyphen in position 93, I type:
^.{92}-
Here are some examples of my data:
009601705-4
008514276-7
008516513-7
009701511-4
009600208-9
(The character before each hyphen is in positon 92).
ben_josephs
Posts: 2464 Joined: Sun Mar 02, 2003 9:22 pm
Post
by ben_josephs » Mon Apr 23, 2012 10:15 pm
You are using "Posix" regular expression syntax, aren't you?
gcotterl
Posts: 252 Joined: Wed Mar 10, 2004 8:43 pm
Location: Riverside California USA
Post
by gcotterl » Mon Apr 23, 2012 10:18 pm
Yes, in the Preferences Edit menu. the "Use POSIX regular expression syntax" box is ticked
gcotterl
Posts: 252 Joined: Wed Mar 10, 2004 8:43 pm
Location: Riverside California USA
Post
by gcotterl » Mon Apr 23, 2012 10:40 pm
I found the problem: At the beginning of each line, there was a tab character.
Subtracting the number of positions represented by the tab character from the number in my original regular expression resulted in successful "finds".