Alternate Solution to RegExp Problem?

Alternate Solution to RegExp Problem?

I think this is also another valid solution to the challenge, and doesn’t need the starting ^.

let username = "JackOfAllTrades";
let userCheck = /([a-z])([a-z]+|[0-9][0-9]+)$[0-9]*/i; // Change this line
let result = userCheck.test(username);


If you don’t specify starting ^ you don’t check the start of the string:

userCheck.test('[email protected]#$%arjunnnij');
// etc...

So it’s not a valid solution, it’s a valid hack of insufficient tests

1 Like

Got it, thanks for the example!