On Thu, 2005-11-24 at 06:25, 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.
> 
> Regards,
> 
> Zoltan
> 
> ---------------------------------------------------------------------
I played around with this using Calc and found that [:digit:] only works
when used with a question mark at the end.  Also, it finds only the
first digit in either a number or a string.  It doesn't yield a
different result if multiple brackets are used.  [:space:]? finds spaces
in Calc as there is usually little else in a Calc application.

Calc also seems a little quirky as I got best results using "find all"
and then going back and finding each individual occurrence.  If I
started with "find" it sometimes worked and other times failed but I
don't know why.
-- 
Fred


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

Reply via email to