Text Processingflags: g
Tab Character
Match literal tab characters — the regex behind every formatter / linter that yells about indentation.
Try it in RegexPro →Available in
Pattern
regexengine-agnostic
\t (flags: g)Raw source: \t
How it works
\t is the escape for the tab character (U+0009). The g flag finds every occurrence. Pair with `replace(re, ' ')` for tabs-to-spaces conversion or use it as a detector to flag mixed indentation.
Examples
Input
spaces\thereMatches
\t
Input
\t\tdouble tabMatches
\t\t
Input
no tabs at allNo match
—Common use cases
- •Tabs-to-spaces conversion in linters
- •Mixed-indentation detection
- •TSV / log parsing
- •Code-formatter diagnostic rules
Related patterns
Non-ASCII Character
Text ProcessingMatch runs of non-ASCII characters (anything outside U+0000–U+007F).
Hashtag
Text ProcessingMatch hashtags (# followed by word characters) in social media posts, including accented Latin characters.
Base64 String
Text ProcessingMatch Base64-encoded strings, including proper padding with = and == characters.
Emoji (Unicode)
Text ProcessingMatch emoji characters across the main Unicode emoji ranges — requires the Unicode flag in JavaScript.