willisoften Posted May 14, 2005 Report Share Posted May 14, 2005 I expected this to find words in a word-list which had at least 8 characters and no more than 9. egrep '[A-Za-z]{8,9}' wordlist My problem is that the 9 doesn't seem to make any difference. So I guess I don't really understand how this works. A number of books and tutorials seem to suggest that n is finite Match only n times {n} but this clearly doesn't seem to be the case. Seems really to be match at least n times. Could some regex guru explain this in small words? I did this last year and don't remember being surprised by the results! Quote Link to comment Share on other sites More sharing options...
willisoften Posted May 14, 2005 Author Report Share Posted May 14, 2005 Actually I forgot a couple of things should have been: egrep '^[A-Za-z]{8,9}$' examples which works - just shows you your memory goes as you get older.......... Quote Link to comment Share on other sites More sharing options...
Cannonfodder Posted May 14, 2005 Report Share Posted May 14, 2005 RegExpressions are powerful, but they can be a pain in the ass if you don't use them regularly.. 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.
Note: Your post will require moderator approval before it will be visible.