开发者

Need a regex for .h or .cpp

I need a regex for finding all .h, .c, and .cpp files in a folder. Help?

[no, this isn't homework, I just don't have time to开发者_开发知识库 learn regexes right now]


Try:

\.(h|c(pp)?)$

But do you really need a regex? Where are you using this?


Try this:

/\.h$|\.c$|\.cpp$/

You can also write it like this:

/\.(h|c|cpp)$/
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜