FD_F Posted November 28, 2009 Share Posted November 28, 2009 i have string to clear example: sdf343-5^% sd fsd%6 how can i clear what NOT [A-Z][a-z][0-9] - and spaces the result should be in this case : sdf343-5 sd fsd6 there is any way give match() flag to do this ? (any other idea will be good) Quote Link to comment Share on other sites More sharing options...
.josh Posted November 28, 2009 Share Posted November 28, 2009 someString = someString.replace(/[^-a-z ]/gi,''); Quote Link to comment Share on other sites More sharing options...
FD_F Posted November 28, 2009 Author Share Posted November 28, 2009 thanks in the end i did str = str.replace(/[^-a-z 0-9]/gi,''); Quote Link to comment Share on other sites More sharing options...
.josh Posted November 28, 2009 Share Posted November 28, 2009 oh sorry, forgot about the digits. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.