in reply to Character class in an array
Hi,
If I understand your problem correctly it is being caused by the default list seperator $" which is set to a space as default. This is used to seperate array values interpolated into a string hence your regex is also allowing spaces in the character class, which I believe is becoming [a x z] in your example above.
I tried code similar to yours with the following line added before the interpolation and it worked fine for me.
$" = '';
HTH,
Neil
Note: all opinion in this post is from a newbie, "wow I think I understood something!" point of view :)