Page 1 of 1

syntax bits and Character Class Operators

Posted: Thu May 31, 2001 12:00 pm
by Elaine Shuman
I have never been able to use the Character Class Operators. They don't seem to work. Example to find a space [:space:]

I tried finding out more about this and saw something about setting the syntax bit.
CAn anyone enlighten me?

thanks

Re: syntax bits and Character Class Operators

Posted: Thu May 31, 2001 12:46 pm
by Andreas
Wrong example.
The character class operators have to be used in a character class.
To find a space:
[[:space:]] (double [ and ] !)
to find a space or a letter from a to c:
[[:space:]a-z]

The outer [ and ] mark the character class,
the inner ones mark the start and end of the character class operator.

Andreas

Re: syntax bits and Character Class Operators

Posted: Thu May 31, 2001 2:54 pm
by Roy Beatty
As long as you're learning how to use Regular Expressions, you might profit by looking at Jeff Epstein's Regex page: <br>
http://www.jeffyjeffy.com/textpad/docum ... n_faq.html

Good luck,

Roy