Distinct Digit in a Number

Published by BijogFc24 in

Write a regular expression that matches numbers whose digits are not repeated (i.e. digits are distinct).

Examples

regularExpression.test("123") ➞ true

regularExpression.test("112233") ➞ false

regularExpression.test("1025") ➞ true

Notes

Input is a number as a string.

Watch a quick demo on how Edabit works.