Mark Phillips wrote:
I am using Dcount() to count the occurrences of some strings in a spreadsheet in OpenOffice Calc 2.0.3. I am using a regular expression to find the string I want.
> ...
... is there a way to modify my regular expression to handle this case.

BTW, I tried using [:alpha:] instead of [a-zA-Z], and dcount() did not find any matches. Is [:alpha:] not working - it is listed in the documentation as a valid regular expression.

I'm not sure I follow what it is you're trying to count--what a 'match' should 
be.

If you just want to count cells that have the string "Board Member", then

.*Board Member.* or .*'Board Member'.*

should be adequate.

If there's something more complicated and you need to stay with your current approach, try removing the single quotes from the character classes. All that does is include the single quote as part of the class, and I think that's where it fails in your example.

\[[a-zA-Z, ]*'Board Member'(, )?[a-zA-Z]*(, )?\]|Board Member

The named classes, e.g. [:alpha:] have some nasty problems. Usually they can be tweaked to work, but sometimes not. Unless you anticipate needing to scan non-Western text, they aren't particularly useful.

If you're still stuck, post some verbatim examples of your data, and indicate which ones should match and what portion of each should match, and I'm sure we can find something that will work.

<Joe

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

Reply via email to