- 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
517 Views
The subexpression/metacharacter “\S” matches the non-white space characters.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexExample { public static void main( String args[] ) { String regex = "\S"; String input = "Hello 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
104 Views
The subexpression/metacharacter “\s” matches the white space equivalent.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexExample { public static void main( String args[] ) { String regex = "\s"; String input = "Hello 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
935 Views
The subexpression/metacharacter “\W” matches the non-word characters.Example1import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexExample { public static void main(String args[]) { String regex = "\W!"; String input = "Hello how are you welcome to Tutorialspoint !"; Pattern p = Pattern.compile(regex); ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
169 Views
The subexpression/metacharacter “\w” matches the word characters i.e. a to z and A to Z and 0 to 9.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexExample { public static void main( String args[] ) { String regex = "\w to"; String input = ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
285 Views
The subexpression/metacharacter “a| b” matches either a or b.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexExample { public static void main( String args[] ) { String regex = "Hello|welcome"; String input = "Hello 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
150 Views
The subexpression/metacharacter “re{ n, m}” matches at least n and at most m 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 = "xyy{2, 4}"; String input = "xxyyzxxyyyyxyyzxxyyzz"; ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
90 Views
The subexpression/metacharacter “re{ n}” matches exactly n number of 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 = "to{1}"; String input = "Welcome to Tutorialspoint"; ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
89 Views
The subexpression/metacharacter “re+” matches one 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
99 Views
The subexpression/metacharacter “\z” matches the end of a string.Example1import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexExample { public static void main( String args[] ) { String regex = "Tutorialspoint\z"; String input = "Hi how are you welcome to Tutorialspoint"; Pattern p ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
422 Views
The subexpression/metacharacter “\Z” matches the end of the entire string except allowable final line terminator.Example 1import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexExample { public static void main( String args[] ) { String regex = "Tutorialspoint\z"; String input = "Hi how are you welcome ... Read More