Regex Series: String Contains at Least One Digit

Published by Mubashir Hassan in

Write a regular expression that matches a string if it contains at least one digit.

Examples

hasDigit("c8") ➞ true

hasDigit("23cc4") ➞ true

hasDigit("abwekz") ➞ false

hasDigit("sdfkxi") ➞ false

Notes

This challenge is designed to use RegEx only.

Watch a quick demo on how Edabit works.