So, their may already be a way of doing this, but I'm trying to make the toString methods of my objects return the constructor name. But, when I tried to use the javascript RegEx the \w (word character) doesn't work. So I create a alias called test with this script.
This just outputs "testing". If I use the equivalent range set though:
I get testing and each letter noted. I tried it in firefox and \w works fine.
world.Note("testing");
var pattern = /\w/g;
var text = "this those that.";
var result = text.match(pattern);
if (result != null) {
for (var i = 0;i < result.length;i++) {
world.Note(i + ":" + result);
}
}
This just outputs "testing". If I use the equivalent range set though:
world.Note("testing");
var pattern = /[a-zA-z0-9_]/g;
var text = "this those that.";
var result = text.match(pattern);
if (result != null) {
for (var i = 0;i < result.length;i++) {
world.Note(i + ":" + result);
}
}
I get testing and each letter noted. I tried it in firefox and \w works fine.