Binary String Regular Expression

Category: Strings

A regular expression to match and validate a Binary String (a sequence of bytes).

/^\d{3}\s?\d{3}$/

Matches

  • 100110
  • 0101100
  • 01011001110

Non-matches:

  • 123456
  • 01011002
  • abcdefg
Rate This Regex
Sending
User Review
0 (0 votes)

Expression Flags

Flags Description
i Ignore case sensitive.
g Allows global search.
m Allows multiline search.