Linked Questions
12 questions linked to/from Best way to alphanumeric check in JavaScript
467 votes
18 answers
1.1m views
How to tell if a string contains a certain character in JavaScript?
I have a page with a textbox where a user is supposed to enter a 24 character (letters and numbers, case insensitive) registration code. I used maxlength to limit the user to entering 24 characters. ...
344 votes
23 answers
639k views
RegEx for Javascript to allow only alphanumeric
I need to find a reg ex that only allows alphanumeric. So far, everyone I try only works if the string is alphanumeric, meaning contains both a letter and a number. I just want one what would allow ...
119 votes
9 answers
145k views
How to convert camelCase to snake_case?
I want to convert a string of that is in camel case to snake case using TypeScript. Remember that the "snake case" refers to the format style in which each space is replaced by an underscore ...
4 votes
3 answers
21k views
javascript validation to allow only numbers and alphabets
Below is my javascript code which allows only alphabets while entering if we enter numbers and some special characters it does not accept them while entering only this works fine but this javascript ...
5 votes
5 answers
5k views
Javascript: How to sort array in by numbers then letters then symbols?
I am trying to order this array in Javascript arr = ["ax", "mof", "4", "63", "42", "3", "10", "[", "23", "adidas", "ba", ")", "ABC"]; And i want that the array is showed like this: ["3", "4", "10", ...
-1 votes
2 answers
2k views
How to restrict user from entering special characters and allow only alphanumeric in input field in angular 8 [duplicate]
I have an input field. I want to restrict user from entering special characters. Only alphanumeric values are allowed. I have implemented below code but when any special characters is pressed it is ...
-1 votes
1 answer
801 views
check alphanumaric or special character enter on textebox
I am trying to check only alphabet in textbox(like XYZ) and any alphanumeric or special character value not entered. But my function only check numeric value and one more condition applied, if i pass ...
-3 votes
1 answer
846 views
How to check if the first character is alpha in JQuery?
Is there any way to check if the first character in the field is an alpha char in Jquery?
-1 votes
3 answers
1k views
how can i prevent to take input onkeypress anything other than alphanumeric
My application is in Arabic and English. Its a hybrid application (html/css/jquery/android). we have one text field in one page and it should take input only alphanumeric (i.e., abc123). i want to ...
0 votes
0 answers
437 views
Angular - Format a text field as phone number only if number is entered
I have an input field that takes in an email or phone number. I want to apply UI mask only if phone number is entered but not when alphabets are entered. How can this be achieved?
3 votes
2 answers
203 views
Are there less memory intensive ways to exclude alphanumeric characters than regular expressions in Javascript?
During an technical interview, I was asked to implement a basic palindrome function that excludes non-alphanumeric characters in Javascript (e.g. "A man, a plan, a canal, Panama."). The code that I ...
-2 votes
2 answers
317 views
How do I validate a given username to only accept alphanumeric values, without using Regex
Currently it validates to true(passes the test) even if username contains just text, or just number characters alone. I want the validation to only be true(Passed) if and only if the username contains ...