This question already has answers here:
Regular expression for hidden files under unix
                                
                                    (5个答案)
                                
                        
                                3个月前关闭。
            
                    
在我的CMakeLists.txt中,我试图找到诸如.git之类的隐藏文件,以排除进一步的操作:

if(${item} MATCHES "\.*")


没为我工作。有什么提示吗?

最佳答案

This answer为我工作:

if(${item} MATCHES "^\\..*")

08-26 00:56