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

Regex - validation for string match the following characters

0 votes
19 views
added Nov 8 in Regex by LC Marshal Lieutenant (14,630 points)
//^([a-z0-9]{5,})$
//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.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...