in Education by
What will be the result when non greedy repetition is used on the pattern /a+?b/? (a) Matches the letter b preceded by the fewest number of a’s possible (b) Matches the letter b preceded by any number of a (c) Matches letter a preceded by letter b, in the stack order (d) Matches letter a present in the string I got this question in an interview. The question is from Pattern Matching and Regular Expressions in portion Classes and Modules in JavaScript of JavaScript Select the correct answer from above options JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The correct option is (a) Matches the letter b preceded by the fewest number of a’s possible The best explanation: Using non greedy repetition may not always produce the results you expect. /a+?b/ matches the letter b preceded by the fewest number of a’s possible.

Related questions

0 votes
    Using which annotation non visible or private method can be tested? (a) @VisibleForTesting (b) @NonVisibleForTesting ... for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    What does the subexpression /java(script)?/ result in? (a) It matches java followed by the ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    Where does the external process save the result of the test? (a) Normal file (b) Flat file (c) ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    What will be the reaction when a catch clause has no conditionals? (a) Takes it to be 0 (b) ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    When will the finally block be called? (a) When there is no exception (b) When the catch does ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
0 votes
    Which of the below is not a valid design pattern? (a) Singleton (b) Factory (c) Command (d) ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of the below is not a valid classification of design pattern? (a) Creational patterns (b) Structural ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
...