开发者

A,B,C,D,E - How can I get "D" with regex? The fourth position of mached result?

A开发者_如何转开发,B,C,D,E - How can I get "D" with regex? The fourth position of mached result?

I can't set "C,(.*),E" because C and E have dynamic values. Thanks!


This captures D in group 2:

([^,]+,){3}([^,]+),


([A-Z],){3}(A-Z),.* should work, if you replace A-Z with the actual character classes used (or [^,] like Sean used above, which matches everything but a comma).

Better to tokenize based on a comma and grab the fourth result, though (assuming the language you're using supports it).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜