Regular Expressions 101

Community Patterns

Match binary calculator, Operands and Operator

1

Regular Expression
ECMAScript (JavaScript)

/
^([0-1]+)(?:([+|\-|\/|*])([0-1]+))*$
/
gm

Description

Match binary number (0 | 1), with or not Operand (+ | - | / | *)

Submitted by chuaschinai - a year ago