This is the P2PU Archive. If you want the current site, go to www.p2pu.org!
You haven't posted any discussions yet.
Here is my pattern: '[A-Z]{3}[a-z][A-Z]{3}'
I'm not entirely sure that it matches ONLY three on each side, can someone confirm or point me in the right place? My source seems to say so.
No it does not, you could be catching three out of four ( or five or more). Maybe you could try some lookbehind?
Yes I noticed that: the regex is flawed. So I went on and did [a-z][A-Z]{3}[a-z][A-Z]{3} to be sure to only catch 3 capitals on each side. I came out with 10 possible matches.
I usually use http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/ as my de-facto reference. It said {3} is exactly three, and {3,} was three+. I guess not!
[A-Z]{3}[a-z][A-Z]{3} will match things like aBCDeFGHi but also things like ABCDeFDHI. You can use [^something] to avoid this second case.