javascript coding

I have a string, for example: 'eadgt789kjh/346,.a4'

I want to filter all the strange characters and numbers and only want to allow characters a…z or A…Z

so I will end up with this: ‘eadgtkjha’

I think it can be done by regular expression, but don’t know how.

There are several methods.

I would look here JavaScript RegExp Object - Using Regular Expressions with Client Side Scripting or buy the pocketguide from o’reilly. A great help in all cases.

Only replacing the numbers can be done with string.replace(/\d/g,“”)

Regular expressions are painful thinking (at least for me), but that one seems easy. This should work:

var regExp = /[^a-zA-Z]/g
var result = yourString.replace(regExp, '');