Page 1 of 1

Can't get [:digit:] to work

Posted: Thu Jun 04, 2009 9:53 pm
by skibumlee
when find

[:digit:]

mark all

text checked

Regular Expressions checked
others unchecked

It tags every line - lines that have no numbers[/list]

Posted: Thu Jun 04, 2009 10:54 pm
by ben_josephs
[:digit:] matches any one of the characters ':', 'd', 'i', 'g', 't'.

What you need is
[[:digit:]]
.

It worked

Posted: Fri Jun 05, 2009 2:53 pm
by skibumlee
wow -
I did not see that in the help

not many examples in the help

Thanks

Posted: Fri Jun 05, 2009 3:37 pm
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.)

Shouldn't the help documentation have double brackets?

Posted: Fri Jun 05, 2009 9:18 pm
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 ... ... ...