- 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
128 Views
The subexpression/metacharacter “(?: re)” groups regular expressions without remembering the matched text.Exampleimport java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class PatternExample { public static void main(String args[]) { //Reading String from user System.out.println("Enter a String"); Scanner sc = new Scanner(System.in); ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
228 Views
The subexpression/metacharacter “( )” groups the regular expressions and remembers the matched text.Example 1import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Example { public static void main( String args[] ) { String input = "Hello how are you welcome to Tutorialspoint"; String regex ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
155 Views
The subexpression/metacharacter “\B” matches the non-word boundaries.Example 1import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexExample { public static void main( String args[] ) { String regex = "\Bcause"; Scanner sc = new Scanner(System.in); System.out.println("Enter a string: "); ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
313 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 specific character from the given input string −Get the input string.This compile() method of this class accepts a string ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
529 Views
The pattern class of the java.regex package is a compiled representation of a regular expression.The compile() method of this class accepts a string value representing a regular expression and returns a Pattern object.Exampleimport java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class CompileExample { public static void main( String args[] ) ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
364 Views
The java.util.regex.Matcher class represents an engine that performs various match operations. There is no constructor for this class you can create/obtain an object of this class using the matches() method of the class java.util.regex.Pattern.The matches() method of this class matches the string with, the pattern represented by the regular expression ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
657 Views
The java.util.regex.Matcher class represents an engine that performs various match operations. There is no constructor for this class you can create/obtain an object of this class using the matches() method of the class java.util.regex.Pattern.The find() method of this class tries to find the next subsequent input matching the current Matcher ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
188 Views
The java.util.regex.Matcher class represents an engine that performs various match operations. There is no constructor for this class you can create/obtain an object of this class using the matches() method of the class java.util.regex.Pattern.The end() method of the Matcher class returns the offset after the last match represented by the ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
222 Views
The java.util.regex.Matcher class represents an engine that performs various match operations. There is no constructor for this class you can create/obtain an object of this class using the matches() method of the class java.util.regex.Pattern.The start() method of the Matcher class returns the starting index of the matched character.ExampleThe subexpression "[...]" ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
Maruthi Krishna
236 Views
You can match the non-word boundaries using the meta character “\B”.Example 1import java.util.Scanner; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Example { public static void main(String args[]) { //Reading String from user System.out.println("Enter a String"); Scanner sc = new Scanner(System.in); ... Read More