- 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 951 Articles
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
142 Views
The subexpression/metacharacter “\A” matches the beginning of the entire string.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexExample { public static void main( String args[] ) { String regex = "\AHi"; String input = "Hi how are you welcome to Tutorialspoint"; ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
123 Views
The subexpression/metacharacter “[^...]” matches any single character, not in brackets.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class SpecifiedCharacters { public static void main( String args[] ) { String regex = "[^hwtyoupi]"; String input = "Hi how are you welcome to Tutorialspoint"; ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
265 Views
The subexpression “[...]” matches any single character specified in the brackets.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class SpecifiedCharacters { public static void main( String args[] ) { String regex = "[hwt]"; String input = "Hi how are you welcome to Tutorialspoint"; ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
94 Views
The subexpression/metacharacter “re*” matches 0 or more occurrences of the preceding expression.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexExample { public static void main( String args[] ) { String regex = "aabc*"; String input = "aabcabcaabcabbcaabcbcaabc"; Pattern p = Pattern.compile(regex); ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
167 Views
The subexpression/metacharacter “\A” matches the beginning of the entire string.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexExample { public static void main( String args[] ) { String regex = "\AHi"; String input = "Hi how are you welcome to Tutorialspoint"; ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
842 Views
The subexpression/metacharacter “.” matches any single character except a newline.Example1import java.util.regex.Matcher; import java.util.regex.Pattern; public class MatchesAll { public static void main( String args[] ) { String regex = "."; String input = "Hi how are you welcome to Tutorialspoint"; Pattern ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
801 Views
The subexpression/metacharacter “$” matches the end of a line.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class EndWith { public static void main( String args[] ) { String regex = "Tutorialspoint$"; String input = "Hi how are you welcome to Tutorialspoint"; Pattern ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
454 Views
The subexpression/metacharacter “^” matches the beginning of a line. If you use this in a regular expression, it matches the sentence succeeding it in the input string.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexExample { public static void main( String args[] ) { String regex = ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
4K+ Views
When an exception is cached in a catch block, you can re-throw it using the throw keyword (which is used to throw the exception objects).While re-throwing exceptions you can throw the same exception as it is without adjusting it as −try { int result = (arr[a])/(arr[b]); System.out.println("Result of ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
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