Javascript regular expressions: how to match ONLY the given characters?

Posted by Dfowj on Stack Overflow See other posts from Stack Overflow or by Dfowj
Published on 2010-05-28T19:17:20Z Indexed on 2010/05/28 21:12 UTC
Read the original article Hit count: 154

Filed under:
|

I'm trying to use a regex like /[computer]{3,8}/ to get any words containing only the letters in computer ranging from 3 to 8 letters long. That regex instead captures all words containing ANY of the letters in [computer]. I've been looking at regular expression examples, but i can't quite figure it out...

How do i modifiy this regular expression to capture words containing ONLY the letters in computer (with a length of 3 to 8)?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about regex