All Topics
Subject Topic16 practice questions

05 Regular ExpressionQuestions & Answers

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

Study Guide & Core Focus Areas

When reviewing 05 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

The first name of a person should contain only alphabets and space. Which of the following regular expression will match the requi…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 a whitespace character in a string?What is the regular expression to match a digit (0-9) in a string?00means X occurs zero or more timesWhat 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 Statement 2 : Matcher class matches …\B means A word boundaryPredict the output of the below code : import java.util.regex.*; public class TestRegEx{ public static void main(String args[]) { …What is the regular expression to match any date in the format "yyyy-mm-dd" in a string?Observe 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.