Are you first timer at Why not join us and start exchange your programming knowledge with everyone. Register today!

Regex - validation for string match the following characters

0 votes
added Nov 8, 2018 in Regex by LC Marshal Lieutenant (17,190 points)
//Use regex.test() for boolean result:

/^([a-z0-9]{5,})$/.test('hello1');   // false
/^([a-z0-9]{5,})$/.test('hello12');   // true
/^([a-z0-9]{5,})$/.test('hello123');   // true

//you could remove the () from regex since there's no need to capture it.


Please log in or register to response this reference. - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.