Open In App

JavaScript RegExp dotAll Property

JavaScript RegExp dotAll property is used to check whether the ‘s’ flag is set or not. If the ‘s’ flag is set then this property returns true else false.

Syntax:



Regexobj.dotAll

Return Value: A boolean value.

Example 1: This example checks if the regular expression contains s Modifier or not. 






function dotAll_prop() {
    let regex = new RegExp(/[a-d]/, 's');
     
    console.log(regex.dotAll)
}
 
dotAll_prop();

Output
true

Example 2: This example checks if the regular expression contains s Modifier or not. 




function dotAll_prop() {
    let regex = new RegExp(/[a-d]/);
 
    if (regex.ignoreCase) {
        console.log("i Modifier is present");
    } else {
        console.log("i Modifier is absent");
    }
}
 
dotAll_prop();

Output
i Modifier is absent

Supported Browsers:

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

Article Tags :