I wish to allow both upper case and lower case. I have tried
'k abBcdi #!129'.replace(/^[A-Za-z0-9]/g,'')
But it’s not give me the correct answer
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Also use [^0-9A-z] instead. It probably has little to no performance effect, but it is slightly shorter and prettier.
Edit:Per a comment above, are you trying to find all letters and numbers and replace them or remove everything that’s not a letter and number?