in reply to Why doesn't quantifier work with character classes?
I thought {8} will match exactly 8 characters, but looks like I am wrong!
You aren't wrong, it does match exactly 8 characters ... but if those 8 characters are at the start of a line containing more than 8 characters, it still matches exactly the first 8.
You need to anchor your regex: Ie. /^[ATGC]{8}$/. Now it will only match lines that contain exactly 8 characters.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why doesn't quantifier work with character classes?
by thezip (Vicar) on Aug 13, 2012 at 22:30 UTC | |
by BrowserUk (Patriarch) on Aug 13, 2012 at 22:53 UTC | |
by rnaeye (Friar) on Aug 13, 2012 at 22:34 UTC |