Hoo boy. A weird one I guess!
getting input from a form, I want to make sure there are no western characters, punctuation or numbers before sending it to a php script for creating some xml...
from form name = "a"
$('form').submit(function() {
text = ($(this).serialize());
text = text.substr(2,text.length)
text = text.replace(/[^\u3040-\u30FF^\uFF00-\uFFEF^\u4E00-\u9FAF^\u3400-\u4DBF]/g,'');
---> text goes to php script using .ajax
However, the Japanese is being converted to ASCII before it gets to the regex!
eg. あああ becomes %E3%81%82%E3%81%82%E3%81%82
Any suggestions?