开发者

Regex matchin string that containts at least one specific character

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 (?&开发者_开发知识库lt;=\s)[A-Z0-9(\-)+]+(?=\s) don't work at all...

Has anybody a good idea?


Try

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

You might not even need the look ahead/behind:

\S*-\S*

may work just fine

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜