: probably....  I'm just not very good at regex ;)
:
:    pattern="--|,|\s-\s|\(|\)"
:
: this will split on "--", " - ", "(", and ")".  I can't figure out how to
: build the pattern so it will trim each thing on the way out.

just make sure you match the whitespace in the pattern, you're already
doing that for the single "-" case, something like this should work but
i haven't tested it...

   pattern="\s*(-|--|,|\(|\))\s*"

...oh, hmm ... you only want to split on - if it has a space on both sides
huh?  does java regex have a "don't be greedy option?" ... javadocs say
yes (they call it "Reluctant" vs "greedy" so try something like this...

   pattern="\s*?(\s-\s|--|,|\(|\))\s*?"

-Hoss

Reply via email to