Saturday, July 4, 2026
HomeLanguagesJavascriptJavaScript RegExp unicode Property

JavaScript RegExp unicode Property

JavaScript RegExp unicode property is used to check whether the ‘u’ flag is set or not in the Regular Expressions flag. If the ‘u’ flag is set then this property returns true else false.

Syntax:

Regexpobj.unicode

Return Type: A boolean value.

Example 1: This example checks whether ‘u’ flag is present or not and prints it on the console.

Javascript




function unicodeProp() {
    let regex = new RegExp(/[a-d]/, 'u');
 
    console.log(regex.unicode);
}
 
unicodeProp();


Output

true

Example 2: This example checks whether ‘u’ flag is present or not.

Javascript




function unicodeProp() {
    let regex = new RegExp(/[a-d]/, 'y');
 
    if (regex.unicode) {
        console.log("u flag is present");
    } else {
        console.log("u flag is absent");
    }
}
 
unicodeProp();


Output

u flag is absent

Supported Browsers:

  • Chrome 50
  • Edge 12
  • Firefox 46
  • Opera 37
  • Safari 10

We have a complete list of Javascript RegExp expressions, to check those please go through this JavaScript RegExp Reference article.

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32519 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6900 POSTS0 COMMENTS
Nicole Veronica
12015 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12110 POSTS0 COMMENTS
Shaida Kate Naidoo
7019 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6976 POSTS0 COMMENTS
Umr Jansen
6967 POSTS0 COMMENTS