Searching for any printable character

  • Thread starter Christopher Brewster via OfficeKB.com
  • Start date
C

Christopher Brewster via OfficeKB.com

I'm trying to do a search that would be easy with Unix regular expressions.
I need to know if there are any non-white characters in a range. If so, I
need to do something with them. I can't use ^w in a wildcard search, so [^w]
doesn't give me "any character that isn't a white space" (it gives me an
error). I may write a little loop that moves forward one character at a
time and searches for a white-space character in each one-character range.
Does someone have a better way to do this?

Christopher Brewster
 
K

Klaus Linke

Hi Christopher,

You can use [^32^9^0160]@ instead of ^w (= any number of spaces, tabs, and non-breaking spaces).
Or use a space " " for ^32, ^t for ^9 and ^s for ^0160.

There are also a couple of white space characters between U+2000 and U+200B you might include, but ^w in regular searches also doesn't match them except for U+2005 (the four-per-em-space).

Greetings,
Klaus
 
K

Klaus Linke

.... or use [!^32^9^0160]@ to match a run of non-whitespace characters.

Klaus
 
C

Christopher Brewster via OfficeKB.com

Klaus, Thanks for the response. I was hoping not to have to enumerate the
characters because, for example, your list doesn't seem to include the
paragraph mark, chr(13). I was hoping for something similar to ^? for
letters. I wonder if MS could possibly remedy this...

Chris Brewster
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top