Regex to catch all files but those starting with "."
Posted
by tmslnz
on Stack Overflow
See other posts from Stack Overflow
or by tmslnz
Published on 2010-05-25T22:14:50Z
Indexed on
2010/05/25
22:21 UTC
Read the original article
Hit count: 189
In a directory with mixed content such as:
.afile
.anotherfile
bfile.file
bnotherfile.file
.afolder/
.anotherfolder/
bfolder/
bnotherfolder/
How would you catch everything but the files (not dirs) starting with .
?
I have tried with a negative lookahead ^(?!\.).+?
but it doesn't seem to work right.
Please note that I would like to avoid doing it by excluding the .
by using [a-zA-Z< plus all other possible chars minus the dot >]
Any suggestions?
© Stack Overflow or respective owner