16 Mar
2007
16 Mar
'07
10:14 a.m.
llwaeva@21cn.com wrote:
But, as I mentioned above, the whole matached string, namely #P{x}, will be replaced once the match is found. So, the character [^#] will also be replaced, that is not what I want.
Try a negative lookbehind: "(?<!#)#" will match any single "#" that is *not* preceded by another #. The previous character (whatever it is) does not form part of the result. John.