RegExp name validation using hexadecimal metacharacters

I want to make a regex validation using hexadecimal metacharacters. the reason i decided to go this way it because i need only the greek language to work.

from http://www.unicode.org/Public/UNIDATA/Blocks.txt i see that i need to use characters from 1F00 to 1FFF. however i cannot find what is going wrong.

here’s what i’ve done so far:

document.querySelector("#register input[name='first_name']").onblur = 

function(){
    /*RegEx about name*/    
    var str = /[u1F00-u1FFF]/g;
    var name = document.querySelector("#registerinput[name='first_name']").value;
    if (name == null || name == ""){
        alert("First name must be filled out!");
    }
    else if(!name.match(str)){
        alert("Name must contain (greek)letters only!");
    }
};


Source: regex

Leave a Reply