Background: I'm trying to get a total line count of all of the code files (.html|.htm|.php|.js|.css) in my root web dir (recursively) by piping the output of this into xargs wc -l | grep total
.
$ find . -regex '.+\.php'
./inc/db.php
./inc/userauth.php
./index.php
.......... etc.
$ find . -regex '.+\.js'
./inc/jquery-1.7.1.js
./inc/script.js
$ find . -regex '.+\.(php|js)'
(returns nothing)
According to this,
abc(def|xyz) matches abcdef or abcxyz
So shouldn't .+\.(php|js)
match all .php files and .js files?
find
uses a different style of regex, so you have to write \(js\|php\)
instead of just (js|php)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With