Regex Series: String Contains at Least One Digit

Published by bangyen in

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

Examples

has_digit("c8") ➞ true

has_digit("23cc4") ➞ true

has_digit("abwekz") ➞ false

has_digit("sdfkxi") ➞ false

Notes

This challenge is designed to use RegEx only.

Watch a quick demo on how Edabit works.