#!/usr/bin/env js

var email = "    c120038@h.koeki-u.ac.jp   \n";

var localpart ="";
var domainpart ="";

  //email.trim()空白削除

if (email.trim().match(/\s*(\S+?)@([^@]+)\s*/)){
    localpart = RegExp.$1;
    domainpart = RegExp.$2;
}
    
print("localpart = "+localpart);
print("domainpart ="+domainpart);
