4 ms·
am I being a bit slow? Why doesn't [^g-z] work on 'ranges'?
by joelanman 13y ago
am I being a bit slow? Why doesn't [^g-z] work on 'ranges'?
- martinml 13y agoBecause for example "beam" matches [^g-z]. That is, it has a letter somewhere that is not between g and z (namely e and a). I came up with ^[a-f]+$ but I'm guessing it could be shorter :) Edit: ah, every word in left column has 4 a-f letters. So [a-f]{4} is a shorter match.
- deleted 13y ago[deleted]
- joelanman 13y agoah you're right :) I was being slow, what I thought I wrote was 'words consisting only of letters that arent g-z'
- bluedino 13y agoAnother dumb question - why does 'beam' not match [bdf][ae] ?
- maxerickson 13y agoIt's complaining because it does match.
- bluedino 13y agoOh. I told you it was a dumb question.