{"id":76628,"date":"2020-02-21T09:51:09","date_gmt":"2020-02-21T04:21:09","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=76628"},"modified":"2020-02-21T09:51:09","modified_gmt":"2020-02-21T04:21:09","slug":"java-regular-expressions","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/","title":{"rendered":"Java Regular Expressions &#8211; Learn its Classes and Interface with Coding Examples"},"content":{"rendered":"<p>We have already discussed the Strings in Java in our article of <em><strong>Java Strings<\/strong><\/em>. We have already worked with Strings and also performed operations and manipulations on Strings. But Strings are not limited to this.<\/p>\n<p>We can also perform more operations on Strings such as searching, manipulating, pattern matching and editing a text. In this article, we will discuss the Regular Expressions in Java which are used to define search patterns in a String.<\/p>\n<h3>Java Regular Expressions<\/h3>\n<p>A regular expression is a group of characters that helps in matching the patterns in a String or a set of Strings, using a particular syntax of a pattern.<\/p>\n<p>Java provides Regular Expressions that are useful for defining patterns in a String which can ultimately be helpful in performing various operations on String\/text like searching, processing, editing, pattern matching, manipulating, email and password validation, etc.<\/p>\n<p>A regular expression is not language-specific but they slightly differ for each language. The regular expression in Java and Perl language are almost similar to each other and are very easy to learn.A regular expression is also known as <strong>Regex<\/strong> in short.<\/p>\n<p>In Java, Regular Expressions are provided under the package <strong>java.util.regex<\/strong>, which is the part of standard Java (Java SE) since Java 1.4. The <strong>Java Regex<\/strong> is an API (Application Programming Interface) used to define a pattern for manipulating or searching Strings.<\/p>\n<p>The package java.util.regex provides three classes and one interface for applying regular expressions:<\/p>\n<h3>Metacharacters of Java Regular Expressions<\/h3>\n<p>The Meta characters used in the regular expressions are:<\/p>\n<table class=\"tv-table-center\">\n<tbody>\n<tr>\n<td><b>Meta Character<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">.<\/span><\/td>\n<td><span style=\"font-weight: 400\">Any character (may or may not match terminator)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">\\d<\/span><\/td>\n<td><span style=\"font-weight: 400\">Any digits &#8211; [ 0-9 ]<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">\\D<\/span><\/td>\n<td><span style=\"font-weight: 400\">Any non-digit &#8211; [ ^0-9 ] (except 0 &#8211; 9)<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">\\s<\/span><\/td>\n<td><span style=\"font-weight: 400\">Any whitespace character &#8211; [ \\t \\n \\f \\r \\x0B ]<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">\\S<\/span><\/td>\n<td><span style=\"font-weight: 400\">Any non-whitespace character &#8211; [ ^\\s ]<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">\\w<\/span><\/td>\n<td><span style=\"font-weight: 400\">Any word character &#8211; [ a-z A-Z _0-9 ]<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">\\W<\/span><\/td>\n<td><span style=\"font-weight: 400\">Any non-word character &#8211; [ ^\\w ]<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">\\b<\/span><\/td>\n<td><span style=\"font-weight: 400\">A word boundary<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">\\B<\/span><\/td>\n<td><span style=\"font-weight: 400\">A non-word boundary<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The three <strong>classes<\/strong> in Java Regex are:<\/p>\n<table class=\"tv-table-center\">\n<tbody>\n<tr>\n<td><b><i>Class<\/i><\/b><\/td>\n<td><b><i>Description<\/i><\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">util.regex.<\/span><b>Pattern<\/b><\/td>\n<td><span style=\"font-weight: 400\">Used to create or define patterns\/regular expressions<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">util.regex.<\/span><b>Matcher<\/b><\/td>\n<td><span style=\"font-weight: 400\">Used to interpret the pattern and performs match operations against an input string.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">util.regex.<\/span><b>PatternSyntaxException<\/b><\/td>\n<td><span style=\"font-weight: 400\">Used to throw an exception if the syntax of a regular expression is incorrect.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>And there is an<strong> interface<\/strong>:<\/p>\n<table class=\"tv-table-center\">\n<tbody>\n<tr>\n<td><b><i>Interface<\/i><\/b><\/td>\n<td><b><i>Description<\/i><\/b><\/td>\n<\/tr>\n<tr>\n<td><b>MatchResult<\/b><span style=\"font-weight: 400\"> interface<\/span><\/td>\n<td><span style=\"font-weight: 400\">Used to find the result of a match operation for a regular expression<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>We will discuss each of the classes and interface in detail along with their methods and syntax.<\/p>\n<h3>Classes in Java Regular Expressions<\/h3>\n<h4>1. java.util.Pattern class<\/h4>\n<p>The Pattern class is used to define or create regular expressions or patterns. This class is a compiled representation of regular expressions that can be used to define various types of patterns. There is no public constructor in Pattern class.<\/p>\n<p>We can use the public static method compile() of this class by passing regular expression as an argument which will create the pattern object after execution.<\/p>\n<h5>Methods of Pattern class<\/h5>\n<p><strong>1.1. static Pattern compile(String regex):<\/strong><\/p>\n<p>This method compiles the specified regular expression into a pattern.<\/p>\n<p><strong>1.2. static Pattern compile(String regex, int flags):<\/strong><\/p>\n<p>This method is similar to the above method but takes one more argument called flag and is used to compile the given regular expression into a pattern with the given flags.<\/p>\n<p><strong>1.3. int flags():<\/strong><\/p>\n<p>This method has no parameters and returns the match flags of a pattern.<\/p>\n<p><strong>1.4. Matcher matcher(CharSequence input):<\/strong><\/p>\n<p>It creates a matcher that will match the given input against this pattern.<\/p>\n<p><strong>1.5. static boolean matches(String regex, CharSequence input):<\/strong><\/p>\n<p>It is used to compile the given regular expression to match the given input String against it.<\/p>\n<p><strong>1.6. String pattern():<\/strong><\/p>\n<p>This method is used to return the regular expression from which we compiled this pattern.<\/p>\n<p><strong>1.7. static String quote(String s):<\/strong><\/p>\n<p>It is used to return a literal pattern String for the stated\/input String.<\/p>\n<p><strong>1.8. String[ ] split(CharSequence input):<\/strong><\/p>\n<p>It splits the given input sequence around matches of this pattern.<\/p>\n<p><strong>1.9. String[ ] split(CharSequence input, int limit):<\/strong><\/p>\n<p>It is used to split the specified input sequence around matches of this pattern within a given limit.<\/p>\n<p><strong>1.10. String toString():<\/strong><\/p>\n<p>It is used to return the pattern in string representation.<\/p>\n<p><strong>Code to understand the Pattern class and its methods:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.regularexpressions;\nimport java.util.regex.*;\n\npublic class PatternClassDemo\n{\n  public static void main(String args[])\n  {\n\n    \/\/Using compile() matches() and matcher() methods\n    boolean match1=Pattern.compile(\"v.d\").matcher(\"vid\").matches();\n    \/\/ . represents a single character\n    System.out.println(match1);\n\n    \/\/Using boolean matches method\n    boolean match2 = Pattern.matches(\"Te..\", \"Tech\");\n    \/\/ .. represents 2 characters\n    System.out.println(match2);\n\n    \/\/ text \"Java\" match pattern \"Ja..\"\n    System.out.println (Pattern.matches(\"Ja..\", \"Java\"));\n\n    \/\/ text \"TechVid\" doesn't match pattern \"TechV.\"\n    System.out.println (Pattern.matches(\"TechV.\", \"TechVid\"));\n\n    String str = \"bbb\";\n    System.out.println(\"Using the String matches method: \"+str.matches(\".bb\"));\n    System.out.println(\"Using Pattern matches method: \"+Pattern.matches(\"b.b\", str));\n  }\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">true<br \/>\ntrue<br \/>\ntrue<br \/>\nfalse<br \/>\nUsing the String matches method: true<br \/>\nUsing Pattern matches method: true<\/div>\n<h4>2. java.util.Matcher class<\/h4>\n<p>The object of Matcher class is an engine which is used to perform match operations of a given regular expression against an input string for multiple times. It finds for multiple occurrences of the regular expressions in the input text\/string.<\/p>\n<p>Like the Pattern class, Matcher too has no public constructors. You can obtain an object of Matcher class from any object of Pattern class by invoking the matcher() method.<\/p>\n<h5>Methods of Pattern class<\/h5>\n<p><strong>2.1. int start():<\/strong><\/p>\n<p>It is used to get the start index of the last character which is matched using find() method.<\/p>\n<p><strong>2.2. int end():<\/strong><\/p>\n<p>It is used to get the end index of the last character which is matched using find() method.<\/p>\n<p><strong>2.3. boolean find():<\/strong><\/p>\n<p>It is used to find multiple occurrences of the input sequence that matches the pattern.<\/p>\n<p><strong>2.4. boolean find(int start):<\/strong><\/p>\n<p>It attempts to find the occurrences of the input sequence that matches the pattern, starting at the specified index.<\/p>\n<p><strong>2.5. String group():<\/strong><\/p>\n<p>This method returns the input subsequence matched by the previous match.<\/p>\n<p><strong>2.6. int groupCount():<\/strong><\/p>\n<p>It is used to return the total number of matched subsequence in this matcher&#8217;s pattern.<\/p>\n<p><strong>2.7. boolean matches():<\/strong><\/p>\n<p>It attempts to match the entire text against the pattern.<\/p>\n<p><strong>2.8. String replaceFirst(String Replacement):<\/strong><\/p>\n<p>Replaces the first subsequence of the input sequence that matches the pattern with the specified replacement string.<\/p>\n<p><strong>2.9. String replaceAll(String Replacement):<\/strong><\/p>\n<p>Replaces every subsequence of the input sequence that matches the pattern with the specified replacement string.<\/p>\n<p><strong>Code to understand the Matcher class and its methods:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.techvidvan.regularexpressions;\nimport java.util.regex.*;\n\npublic class MatcherClassDemo\n{\n  public static void main(String args[])\n  {\n    \/\/Case Sensitive Searching\n    \/\/ Creating a pattern \"Tech\" to be searched\n    Pattern pattern = Pattern.compile(\"Tech\");\n\n    \/\/ Searching above pattern in \"TechJavaTechVidvan\"\n    Matcher match = pattern.matcher(\"TechJavatechVidvan\");\n\n    \/\/ Printing start and end indexes of the pattern in text\n    System.out.println(\"Case Sensitive Searching:\");\n    while (match.find())\n\n      System.out.println(\"Pattern found from \" + match.start() +\n          \" to \" + (match.end()-1));\n\n    \/\/Case Insensitive Searching\n    Pattern pattern1= Pattern.compile(\"te*\", \t\t\tPattern.CASE_INSENSITIVE);\n    \/\/ Searching above pattern in \"TechJavaTechVidvan\"\n    Matcher match1 = pattern1.matcher(\"TechJavatechVidvan\");\n    System.out.println(\"\\nCase InSensitive Searching:\");\n    \/\/ Printing start and end indexes of the pattern in text\n    while (match1.find())\n      System.out.println(\"Pattern found from \" + match1.start() +\n          \" to \" + (match1.end()-1));\n\n    \/\/ Splitting the String\n\n    String text = \"Tech@VidVan#Tutorial&amp;Of%Java\";\n    String delimiter = \"\\\\W\";\n    Pattern pattern2 = Pattern.compile(delimiter, Pattern.CASE_INSENSITIVE);\n\n    String[] result = pattern2.split(text);\n    System.out.println(\"\\nSplitting the String around special characters:\");\n    for (String temp: result)\n      System.out.println(temp);\n\n    \/\/ Replacing the String\n    System.out.println(\"\\nReplacing the Strings with other String:\");\n    String regex = \"Python\";\n    String inputString = \"TechVivdan Python Tutorial. \" + \"It is a Python Tutorial\";\n    String replaceString = \"Java\";\n\n    \/\/ get a Pttern object\n    Pattern pattern3 = Pattern.compile(regex);\n\n    \/\/ get a matcher object\n    Matcher m = pattern3.matcher(inputString);\n\n    System.out.println(\"Using replaceFirst() Method\");\n    inputString = m.replaceFirst( replaceString);\n    System.out.println(inputString);\n\n    System.out.println(\"\\nUsing replaceAll() Method\");\n    inputString = m.replaceAll( replaceString);\n    System.out.println(inputString);\n\n  }\n\n}<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<div class=\"code-output\">Case Sensitive Searching:<br \/>\nPattern found from 0 to 3Case InSensitive Searching:<br \/>\nPattern found from 0 to 1<br \/>\nPattern found from 8 to 9Splitting the String around special characters:<br \/>\nTech<br \/>\nVidVan<br \/>\nTutorial<br \/>\nOf<br \/>\nJava<\/p>\n<p>Replacing the Strings with other String:<br \/>\nUsing replaceFirst() Method<br \/>\nTechVivdan Java Tutorial. It is a Python Tutorial<\/p>\n<p>Using replaceAll() Method<br \/>\nTechVivdan Java Tutorial. It is a Java Tutorial<\/p>\n<\/div>\n<h4>3. java.util.PatternSyntaxException class<\/h4>\n<p>This class throws an unchecked exception to indicate a syntax error in a regular-expression pattern.<\/p>\n<h5>Methods of Pattern class<\/h5>\n<p><strong>3.1. String getDescription():<\/strong><\/p>\n<p>It is used to get the description of the error.<\/p>\n<p><strong>3.2 int getIndex():<\/strong><\/p>\n<p>It is used to get the index of the error.<\/p>\n<p><strong>3.3 String getMessage():<\/strong><\/p>\n<p>This method gives a multiple-line string, describing the syntax error along with its index. It also gives the erroneous regular-expression pattern and indicates the index or error within the pattern.<\/p>\n<p><strong>3.4 String getPattern():<\/strong><\/p>\n<p>It is used to get the erroneous regular-expression pattern.<\/p>\n<h3>Interface in Java Regular Expressions<\/h3>\n<p>There is an interface provided in java.util.regex package: <strong>MatchResult Interface<\/strong>.<\/p>\n<h4><strong>MatchResult Interface:<\/strong><\/h4>\n<p>This interface is used to get the result of a match operation against a regular expression. This interface allows for finding match boundaries, groups and group boundaries, but the modification is not allowed through this interface.<\/p>\n<h5>Methods of Pattern class<\/h5>\n<p><strong>1. int end():<\/strong><\/p>\n<p>It returns the index after the last character matched.<\/p>\n<p><strong>2. int end(int group):<\/strong><\/p>\n<p>It returns the offset after the last character of the subsequence captured by the specified group during this match.<\/p>\n<p><strong>3. String group():<\/strong><\/p>\n<p>This method returns the input subsequence matched by the previous match.<\/p>\n<p><strong>4. String group(int group):<\/strong><\/p>\n<p>It returns the input subsequence captured by the specified group during the previous match operation.<\/p>\n<p><strong>5. int start():<\/strong><\/p>\n<p>It returns the start index of the match.<\/p>\n<p><strong>6. int start(int group):<\/strong><\/p>\n<p>It returns the start index of the subsequence captured by the given group during this match.<\/p>\n<h3>Summary<\/h3>\n<p>Regular Expressions are very helpful in manipulating and matching the patterns against a String. It helps in the validation and password checking.<\/p>\n<p>In this article, we were able to see how regular expressions assist in pattern matching and performing many operations on the String. We covered its core classes and interfaces along with their methods and Java codes for better understanding.<\/p>\n<p>This article will surely help you to build up your concepts in Regular Expressions.<\/p>\n<p>Thank you for reading our article. If you have any queries, do let us know through the comment box below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have already discussed the Strings in Java in our article of Java Strings. We have already worked with Strings and also performed operations and manipulations on Strings. But Strings are not limited to&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":76889,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[183],"tags":[1810,1811,1812,1813,1814,1815,1816,1817],"class_list":["post-76628","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","tag-examples-of-java-regular-expression","tag-java-regex","tag-java-regex-example","tag-java-regular-expression","tag-java-regular-expression-classes","tag-java-regular-expression-interface","tag-java-regular-expression-metacharacter","tag-regular-expression-in-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Java Regular Expressions - Learn its Classes and Interface with Coding Examples - TechVidvan<\/title>\n<meta name=\"description\" content=\"Get to know in detail about the concept of Java Regular Expressions &amp; explore its core classes &amp; interfaces along with their methods &amp; codes for better understanding.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java Regular Expressions - Learn its Classes and Interface with Coding Examples - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Get to know in detail about the concept of Java Regular Expressions &amp; explore its core classes &amp; interfaces along with their methods &amp; codes for better understanding.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-21T04:21:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/02\/classes-in-java-regular-expressions.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java Regular Expressions - Learn its Classes and Interface with Coding Examples - TechVidvan","description":"Get to know in detail about the concept of Java Regular Expressions & explore its core classes & interfaces along with their methods & codes for better understanding.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/","og_locale":"en_US","og_type":"article","og_title":"Java Regular Expressions - Learn its Classes and Interface with Coding Examples - TechVidvan","og_description":"Get to know in detail about the concept of Java Regular Expressions & explore its core classes & interfaces along with their methods & codes for better understanding.","og_url":"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2020-02-21T04:21:09+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/02\/classes-in-java-regular-expressions.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Java Regular Expressions &#8211; Learn its Classes and Interface with Coding Examples","datePublished":"2020-02-21T04:21:09+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/"},"wordCount":1373,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/02\/classes-in-java-regular-expressions.jpg","keywords":["Examples of Java regular expression","Java Regex","java regex example","Java Regular Expression","Java Regular Expression Classes","Java Regular Expression Interface","Java Regular Expression Metacharacter","regular expression in java"],"articleSection":["Java Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/","url":"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/","name":"Java Regular Expressions - Learn its Classes and Interface with Coding Examples - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/02\/classes-in-java-regular-expressions.jpg","datePublished":"2020-02-21T04:21:09+00:00","description":"Get to know in detail about the concept of Java Regular Expressions & explore its core classes & interfaces along with their methods & codes for better understanding.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/02\/classes-in-java-regular-expressions.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/02\/classes-in-java-regular-expressions.jpg","width":802,"height":420,"caption":"Java Regular Expressions Classes"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/java-regular-expressions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Java Regular Expressions &#8211; Learn its Classes and Interface with Coding Examples"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/76628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=76628"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/76628\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/76889"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=76628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=76628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=76628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}