
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Maruthi Krishna has Published 870 Articles

Maruthi Krishna
1K+ Views
The replaceAll() method of the List interface accept an object of the UnaryOperator representing a particular operation, performs the specified operation on all the elements of the current list and replaces the existing values in the list with their respective results.Example Live Demoimport java.util.ArrayList; import java.util.function.UnaryOperator; class Op implements UnaryOperator { ... Read More

Maruthi Krishna
286 Views
Following regular expression matches given e-mail id including the blank input −^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2, 6})?$Where, ^ matches the starting of the sentence.[a-zA-Z0-9._%+-] matches one character from English alphabet (both cases), digits, "+", "_", ".", "" and, "-" before the @ symbol.+ indicates the repetition of the above mentioned set of characters one ... Read More

Maruthi Krishna
144 Views
The java.util.regex.MatcheResult interface provides methods to retrieve the results of a match.You can get an object of this interface using the toMatchResult() method of the Matcher class. This method returns a MatchResult object which represents the match state of the current matcher.The groupCount() method of this interface counts and returns ... Read More

Maruthi Krishna
511 Views
Greedy quantifiers are the default quantifiers. A greedy quantifier matches as much as possible from the input string (longest match possible) if match not occurred it leaves the last character and matches again. Following is the list of greedy quantifiers −QuantifierDescriptionre*Matches zero or more occurrences.re?Matches zero or, 1 occurrence.re+Matches one ... Read More

Maruthi Krishna
388 Views
The regular expression "\S" matches a non-whitespace character and the following regular expression matches one or more non space characters between the bold tags."(\S+)"Therefore to match the bold fields in a HTML script you need to −Compile the above regular expression using the compile() method.Retrieve the matcher from the obtained ... Read More

Maruthi Krishna
583 Views
The subexpression/metacharacter “\E” ends the quoting begun with \Q. i.e. you can escape metacharacters in the regular expressions by placing them in between \Q and \E. For example, the expression [aeiou] matches the strings with vowel letters in it.Example Live Demoimport java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class SampleProgram { ... Read More

Maruthi Krishna
122 Views
The PatternSyntaxException class represents an unchecked exception thrown in case of a syntax error in regex string. This class contains three main methods namely −getDescription() − Returns the description of the error.getIndex() − Returns the error index.getPattern() − Returns the regular expression pattern with error.getMessage() − Returns the complete message congaing ... Read More

Maruthi Krishna
83 Views
The java.util.regex.MatcheResult interface provides methods to retrieve the results of a match.You can get an object of this interface using the toMatchResult() method of the Matcher class. This method returns a MatchResult object which represents the match state of the current matcher.The end(int group) method of this interface accepts an integer ... Read More

Maruthi Krishna
406 Views
This character class \p{javaMirrored} matches upper case letters. This class matches the characters which returns true when passed as a parameter to the isMirrored() method of the java.lang.Character class.Example 1 Live Demoimport java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexExample { public static void main(String args[]) { ... Read More

Maruthi Krishna
463 Views
This character class \p{javaWhitespace} matches spaces. This class matches the characters which returns true when passed as a parameter to the isWhitespace() method of the java.lang.Character class.Example 1 Live Demoimport java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexExample { public static void main(String args[]) { //Reading String ... Read More