16 Mar
2007
16 Mar
'07
8:23 a.m.
Presumably it's because you're not anchoring the regexp to the start of the string - you're original regexp will work with 2 #s because it finds a match starting at the 2nd one. If you were to start your regexp thus: "^[#]P" then it would not say that the ## case was correct.
Thanks! But it seems still not solve the problem Because the pattern being searched doesn't necessary locate at the beginning of the source string, i.e. the source is likely "abcdefgd##P{xyz}ewerw" Thanks, anyway.