phorcon3 Posted November 28, 2009 Share Posted November 28, 2009 var string = ' word word. '; so, all words which don't have a period as the last character should be replaced with invalid string.replace(/[a-zA-Z]{1,}[^\.]/gi, 'invalid'); but [^\.] doesnt work, does anyone else know what to put in instead? Quote Link to comment Share on other sites More sharing options...
.josh Posted November 28, 2009 Share Posted November 28, 2009 string.replace(/[a-z]{1,}([^.a-z])/gi, 'invalid$1'); 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.