当前位置: 动力学知识库 > 问答 > 编程问答 >

Atom regex to match file path

问题描述:

I'm using Atom. I've pressed the ".*" button to turn on regular expressions. I'm trying to search for a string only in a file with a path that contains the "src" directory somewhere in the path. I would expect .*\/src\/.* to work but it doesn't. I've tried a bunch of permutations of this but still no luck.

What am I doing wrong?

Sample path "/Users/me/Development/ui/ui-enduser/src/main/js/config/AppConfiguration.js"

网友答案:

/ is a special character in regular expressions. Try escaping them: \/src\/, or if you want the whole string, ^.*\/src\/.*

分享给朋友:
您可能感兴趣的文章:
随机阅读: