keymasterviriya1150

isThai

Jul 17th, 2023
822
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let m;
  2.  
  3. const isThai = (str) => {
  4.   const regexThai = /([\u0E00-\u0E7F]+)/gmu;
  5.   const found = str.match(regexThai);
  6.   if (!found) return false;
  7.   return true;
  8. };
  9.  
  10. const str = `engภาษาไทยที่มีสระ123!@`;
  11. const str2 = "asdSD";
  12.  
  13. console.log(isThai(str2));
  14.  
Advertisement
Add Comment
Please, Sign In to add comment