File & Path
Hidden File (Dotfile)
Matches Unix-style hidden files (dotfiles) like .gitignore or .env.
Try it in RegexProPattern
regexJavaScript
/^\.[^.\s/\\][^/\\]*$/Raw source: ^\.[^.\s/\\][^/\\]*$
How it works
`^\.` requires leading dot. `[^.\s/\\]` requires the next character to not be another dot, whitespace, or slash. `[^/\\]*$` allows any additional non-slash characters.
Examples
Input
.gitignoreMatches
.gitignore
Input
.env.localMatches
.env.local
Input
..No match
—Common use cases
- File system tools
- Git utilities
- Config discovery