All Topics
Topic16 questions
5. Regular ExpressionQuestions & Answers
Practice 16 5. Regular Expression questions with detailed answers and explanations. Tap any question below to study the full solution.
5. Regular Expression question list
Which of the following text when matched with the regular expression [a-zA-Z&&[^aeiou]]+ will return true?What is the regular expression to match any date in the format "yyyy-mm-dd" in a string?a regular expression, the pattern 00 means, 0 occurs exactly two times.What is the regular expression to match a whitespace character in a string?The first name of a person should contain only alphabets and space. Which of the following regular expression will match the requi…What is the regular expression to match any email address in a string?Consider the below statements. Statement 1 : Matcher class interprets the pattern in a String Statement2:Matcherclassmatchesthereg…What is the regular expression to match a digit (0-9) in a string?Predict the output of the below code : import java.util.regex.*; public class TestRegEx{ public static void main(String args[]) { …\B means A word boundaryObserve the below code snippet String name="Sudha learns Oracle"; System.out.println(name.substring(7,12)); What is the output of …Predict the output of the below code : String emailId="john#global.com"; System.out.println(emailId.indexOf('@'));What can be the parameters for the indexOf method in String class?Observe the below code : String course="Java Programming"; char c=course.charAt(16); System.out.println(c); What will be the outpu…Assume that the ID of an employee should start with "CBE" or "BLR" or "HYD" followed by hyphen (-) followed by 4 digits. Choose th…Which of the following matches X occurs n or more times?Practice more topics
PrimerPrep has independently reviewed practice questions and coding exercises — all free.