Zoltán Kócsi wrote:
Find [:space:]


Try [[:space:]] instead.

The [:space:] shorthand stands for all space-like characters, like
tab, space, formfeed and so on. It is hard to write visible spaces,
so consider this to understand: [:digit:] stands for the set
of characters that are digits, i.e. 0123456789

If you search for [:digit:] you search for "0123456789" and *not*
one of 0, 1, ... 9. On the other hand, if you write [[:digit:]] then
first [:digit:] gets substituted with 0123456789 and thus you get
[0123456789] which is what you want, any of 0, 1, ... 9.

The same is true for the space thing. [:space:] will be sustituted with
"<space><tab><formfeed><whatever_else_is_considered_whitespace>", that
is a sequence of characters that all appear blank. You do not want
that, you want any of those, hence you write [[:space:]].
If you want to look for space as such, a single space should be
sufficient. If, on the other hand, OOo's  pattern search (I'm
guessing here) trims your regexp from leading and trailing spaces, you
can still use [ ], which defines a set of one character, the space.


Thanks very much. I had never been able to make the [[:space:]] thing work. Now, having just tried it, I find that what I should be using is [ ], with nothing but a space between the brackets.

It's the wording of the Regular Expressions list that's misleading for people with literal minds like mine. What could they do to remedy the situation, other than give a full explanation as you've just done?

JimW

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to