regular expression arabic and persion

JavaScript
function Just_persian(str){
  if(persianRex.text.test(str))
    alert("not format");
}function Just_persian(str){
  if(persianRex.text.test(str))
    alert("not format");
  //p;
}
Source

Also in JavaScript: