tags:

views:

34

answers:

1

I'm trying to create an expression that matches anything between two whitespaces that does contain at least one - but have no f** idea how to do that.

Trying things like (?<=\s)[A-Z0-9(\-)+]+(?=\s) don't work at all...

Has anybody a good idea?

+3  A: 

Try

(?<=\s)\S*-\S*(?=\s)

You might not even need the look ahead/behind:

\S*-\S*

may work just fine

Manu
That's one neat idea...
ApoY2k