Regular Expressions
- What does public int start() return?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
public int start() returns index of the previous match in the input string.
- what does public String replaceAll(string replace) do?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
replaceAll method replaces every subsequence of the sequence that matches pattern with a replacement string.
- What does public int end(int group) return?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
public int end(int group) returns offset from the last character of the subsequent group.
- Which of the following matches end of the string using regular expression in java?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
\z is used to match end of the entire string in regular expression in java.
- Which of the following matches nonword character using regular expression in java?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
\W matches nonword characters. [0-9], [A-Z] and _ (underscore) are word characters. All other than these characters are nonword characters.