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! 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.......... 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.. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now