← Back to challenges

Regex Series: Even Number?

JavaScriptHardstringsregexvalidation

Instructions

Write a regular expression that matches only an even number. Numbers will be presented as strings.

Examples

"2341" ➞ false

"132" ➞ true

"29" ➞ false

"5578" ➞ true

Notes

This challenge is designed for RegEx only.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Find the Largest Numbers in a Group of Arrays