I am using a Mac OSX 10.8.3 and the previous answer does not work for me, but this does:
sed -E '/\.(rb|js)$/!d'
Note: use -E
to
Interpret regular expressions as extended (modern) regular expressions rather than basic regular expressions (BRE's).
and this enables the OR function |
; other versions seem to want the -r
flag to enable extended regular expressions.
Note that the initial .
must be escaped and the trailing $
must not be.