All Topics
Subject Topic16 practice questions

5. Regular ExpressionQuestions & Answers

Master 5. Regular Expression with verified practice questions, step-by-step logic, and deep conceptual explanations.

Study Guide & Core Focus Areas

When reviewing 5. Regular Expression, pay special attention to edge cases, time/space complexity tradeoffs, and syntax nuances. Attempt each question independently before revealing the explanation to reinforce active recall.

Topic Question Index

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 authored practice questions and coding exercises across 8 core subjects — all free.