开发者

Need a regex for .h or .cpp

开发者 https://www.devze.com 2022-12-31 14:29 出处:网络
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:

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

精彩评论

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

关注公众号