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\there

Matches

  • \t

Input

\t\tdouble tab

Matches

  • \t
  • \t

Input

no tabs at all

No match

Common use cases

  • Tabs-to-spaces conversion in linters
  • Mixed-indentation detection
  • TSV / log parsing
  • Code-formatter diagnostic rules

Related patterns