File & Path
Hidden File (Dotfile)
Matches Unix-style hidden files (dotfiles) like .gitignore or .env.
Try it in RegexPro →Available in
Pattern
regexengine-agnostic
^\.[^.\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
Related patterns
.env File Key-Value Line
File & PathParse KEY=value lines from .env config files, handling quoted values and trailing comments.
Unix File Path
File & PathMatches absolute Unix/Linux file paths.
Dockerfile ENV Instruction
File & PathMatch Dockerfile `ENV KEY=value` (or `ENV KEY value`) instructions, capturing key and value.
File Extension
File & PathCaptures the file extension from a filename.