- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 995 Articles
Maruthi Krishna
831 Views
The class named File of the java.io package represents a file or directory (path names) in the system. This class provides various methods to perform various operations on files/directories. The mkdir() method of this class creates a directory with the path represented by the current object. Creating directory hierarchy There ... Read More
Maruthi Krishna
64K+ Views
To verify whether a given input string is a valid e-mail id match it with the following is the regular expression to match an e-mail id −"^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$"Where, ^ matches the starting of the sentence.[a-zA-Z0-9+_.-] matches one character from the English alphabet (both cases), digits, "+", "_", "." and, "-" before ... Read More
Maruthi Krishna
632 Views
Enables Unicode-aware case folding. When you use this as flag value to the compile() method along with the CASE_INSENSITIVE flag and if you search for Unicode characters using regular expressions Unicode characters of both cases will be matched. Example import java.util.regex.Matcher; import java.util.regex.Pattern; public class UNICODE_CASE_Example { public static void main( String ... Read More
Maruthi Krishna
193 Views
This flag enables Unix lines mode. In the Unix lines mode, only '' is used as a line terminator and ‘\r’ is treated as a literal character. Example 1 import java.util.regex.Matcher; import java.util.regex.Pattern; public class LTERAL_Example { public static void main(String[] args) { String input = "This ... Read More
Maruthi Krishna
408 Views
Enables the Unicode version of Predefined character classes and POSIX character classes. Example import java.util.regex.Matcher; import java.util.regex.Pattern; public class UNICODE_CHARACTER_CLASS_Example { public static void main( String args[] ) { String regex = "\u00de"; //Compiling the regular expression ... Read More
Maruthi Krishna
727 Views
The CANON_EQ field of the Pattern class matches two characters only if they are canonically equal. When you use this as flag value to the compile() method, two characters will be matched if and only if their full canonical decompositions are equal. Where canonical decomposition is one of the Unicode text ... Read More
Maruthi Krishna
837 Views
Enables literal parsing of the pattern. In this, all the characters including escape sequences and, meta-characters don’t have any special meaning they are treated as literal characters. For example, normally if you search for the regular expression “^This” in the given input text it matches the lines starting with the word ... Read More
Maruthi Krishna
2K+ Views
Enables multiline mode in general, the ^ and $ meta characters matches the start and end of the given input with the specified characters irrespective of the number of lines in it. Example 1 import java.util.regex.Matcher; import java.util.regex.Pattern; public class MULTILINE_Example { public static void main( String args[] ) { ... Read More
Maruthi Krishna
807 Views
Built-in reverse() method The StringBuffer class provides you a method named reverse(). It reverses the contents of the current StringBuffer object and returns the resultant StringBuffer object. It is the easiest way to reverse a Sting using Java. To do so − Instantiate the StringBuffer class by passing the required String as ... Read More
Maruthi Krishna
3K+ Views
The java.util.regex package of java provides various classes to find particular patterns in character sequences. The pattern class of this package is a compiled representation of a regular expression. To match a regular expression with a String this class provides two methods namely − compile() − This method accepts a string representing ... Read More