Menu

gitpiper

isAlphaNumeric javascript Code Snippet in 2024

stringregexpbeginner

Last Updated: 20 April 2024

Checks if a string contains only alphanumeric characters.

  • Use RegExp.prototype.test() to check if the input string matches against the alphanumeric regexp pattern.
const isAlphaNumeric = str => /^[a-z0-9]+$/gi.test(str);
isAlphaNumeric('hello123'); // true isAlphaNumeric('123'); // true isAlphaNumeric('hello 123'); // false (space character is not alphanumeric) isAlphaNumeric('#$hello'); // false

javascript snippet similar to isAlphaNumeric For You in April 2024

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2024 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️