开发者

Need help with a regex pattern for matching part of word until next uppercase letter

I need part of a word. For e开发者_如何学运维xample if we have "CheckResults" I just want to get "Check". Can someone help me with regex for this?


\b[A-Z][a-z]+

Finds the begining of a word and then matches until the end of the word or a capital letter. If the word won't always be capitalized, use this:

\b[A-Z]?[a-z]+
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜