What will be the output of the following JavaScript code? console.log(Pattern.matches("[^abc]", "aemngq")); a) true
View Question
What will be the output of the following JavaScript code?
Console.log(Pattern.matches(“[adf]+”, “a”));
What will be the output of the following JavaScript code? Console.log(Pattern.matches("[adf]+", "a")); a) true b) false
View Question
What will be the output of the following JavaScript code?
console.log(Pattern.matches(“\\d”, “1”));
What will be the output of the following JavaScript code? console.log(Pattern.matches("\\d", "1")); a) ...
View Question
What will be the output of the following JavaScript code?
console.log(Pattern.matches(“[amn]?”, “a”));
What will be the output of the following JavaScript code? console.log(Pattern.matches("[amn]?", "a")); a) true b) false c) undefined d) bcd
View Question
What will be the output of the following JavaScript code?
console.log(Pattern.matches(“[amn]”, “abcd”));
What will be the output of the following JavaScript code? console.log(Pattern.matches("[amn]", ...
View Question
What will be the purpose of exec() in the following JavaScript code?
var pattern = /Java/g;
var text = “JavaScript is more fun than Java!”;
var result;
while ((result = pattern.exec(text)) != null)
{
alert(“Matched ‘” + result[0] + “‘” +” at position ” + result.index +”; next search begins at ” + pattern.lastIndex);
}
What will be the purpose of exec() in the following JavaScript code? var pattern ...
View QuestionWhat would be the result of the following statement in JavaScript using regular expression methods?
a) Returns [“123″”456″”789”] b) Returns [“123″,”456″,”789”] c) Returns [1,2,3,4,5,6,7,8,9] d) Throws an exception Answer: b Explanation: The split() method ...
View QuestionThe method that performs the search-and-replace operation to strings for pattern matching is _______
a) searchandreplace() b) add() c) edit() d) replace() Answer: d Explanation: The replace() method performs a search-and-replace operation. It ...
View QuestionWhat is the most essential purpose of parentheses in regular expressions?
a) Define pattern matching techniques b) Define subpatterns within the complete pattern c) Define portion of strings in the ...
View QuestionWhat does the subexpression /java(script)?/ result in?
a) It matches “java” followed by the optional “script” b) It matches “java” followed by any number of ...
View Question