Can't get [:digit:] to work

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
skibumlee
Posts: 3
Joined: Thu Jun 04, 2009 9:40 pm

Can't get [:digit:] to work

Post by skibumlee »

when find

[:digit:]

mark all

text checked

Regular Expressions checked
others unchecked

It tags every line - lines that have no numbers[/list]
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

[:digit:] matches any one of the characters ':', 'd', 'i', 'g', 't'.

What you need is
[[:digit:]]
.
skibumlee
Posts: 3
Joined: Thu Jun 04, 2009 9:40 pm

It worked

Post by skibumlee »

wow -
I did not see that in the help

not many examples in the help

Thanks
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

From the Help on "How to Use Regular Expressions:
Character Class Operators "[: ... :]":
These can be used in class expressions as an alternative way of representing classes of characters. For example, [a-z0-9] is equivalent to [[:lower:][:digit:]]. (Note the extra pairs of brackets.)
Hope this was helpful.............good luck,
Bob
skibumlee
Posts: 3
Joined: Thu Jun 04, 2009 9:40 pm

Shouldn't the help documentation have double brackets?

Post by skibumlee »

[[:alpha:]] Any letter.
[[:lower:]] Any lower case letter.
[[:upper:]] Any upper case letter.
[[:alnum:]] Any digit or letter.
[[:digit:]] Any digit.
[[:xdigit:]] Any hexadecimal digit (0-9, a-f or A-F).
[[:blank:]] Space or tab.
[[:space:]] Space, tab, vertical tab, return, line feed, form feed.
[[:cntrl:]] Control characters (Delete and ASCII codes less than space).
[[:print:]] Printable characters, including space.
[[:graph:]] Printable characters, excluding space.
[[:punct:]] Anything that is not a control or alphanumeric character.
[[:word:]] Letters, hypens and apostrophes.
[[:token:]] Any of the characters defined on the Syntax page ... ... ...
Post Reply