{"id":5898,"date":"2023-11-06T14:05:23","date_gmt":"2023-11-06T21:05:23","guid":{"rendered":"https:\/\/ioflood.com\/blog\/?p=5898"},"modified":"2024-02-26T13:54:30","modified_gmt":"2024-02-26T20:54:30","slug":"java-matcher","status":"publish","type":"post","link":"https:\/\/ioflood.com\/blog\/java-matcher\/","title":{"rendered":"Java Matcher Class: Your Guide to Identifying Patterns"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/ioflood.com\/blog\/wp-content\/uploads\/2023\/11\/java_matcher-300x300.jpg\" alt=\"java_matcher\" width=\"300\" height=\"300\" title=\"\"><\/figure>\n<\/div>\n<p>Are you finding it challenging to work with the Java Matcher class? You&#8217;re not alone. Many developers find themselves puzzled when it comes to handling pattern matching in Java, but we&#8217;re here to help.<\/p>\n<p>Think of the Java Matcher class as a detective &#8211; it helps you find patterns in your data, providing a versatile and handy tool for various tasks.<\/p>\n<p><strong>In this guide, we&#8217;ll walk you through the process of mastering the Java Matcher class<\/strong>, from its basic usage to more advanced techniques. We&#8217;ll cover everything from the basics of pattern matching to more advanced techniques, as well as alternative approaches.<\/p>\n<p>Let&#8217;s get started and start mastering the Java Matcher class!<\/p>\n<h2>TL;DR: What is the Java Matcher Class?<\/h2>\n<blockquote><p>\n  The Matcher class in Java is a powerful tool used for matching character sequences against a given pattern, instantiated with the syntax <code>Matcher matcher = pattern.matcher(\"patternToMatch\");<\/code>. It&#8217;s a crucial part of the Java regular expression API and plays a significant role in pattern matching and data validation tasks.\n<\/p><\/blockquote>\n<p>Here&#8217;s a simple example:<\/p>\n<pre><code class=\"language-java line-numbers\">Pattern pattern = Pattern.compile(\"abc\");\nMatcher matcher = pattern.matcher(\"abcdef\");\nboolean matchFound = matcher.find();\n\n\/\/ Output:\n\/\/ true\n<\/code><\/pre>\n<p>In this example, we create a <code>Pattern<\/code> object with the pattern <code>\"abc\"<\/code>. We then create a <code>Matcher<\/code> object by invoking the <code>matcher<\/code> method on our <code>Pattern<\/code> object. The <code>matcher<\/code> method takes in the string <code>\"abcdef\"<\/code> that we want to search for our pattern in. Finally, we call the <code>find<\/code> method on our <code>Matcher<\/code> object to check if our pattern is found in the string. The <code>find<\/code> method returns <code>true<\/code> because our pattern <code>\"abc\"<\/code> is found in the string <code>\"abcdef\"<\/code>.<\/p>\n<blockquote><p>\n  This is a basic way to use the Matcher class in Java, but there&#8217;s much more to learn about pattern matching and the advanced usage of the Matcher class. Continue reading for a more detailed understanding of the Matcher class and its advanced usage.\n<\/p><\/blockquote>\n<h2>Basic Usage of Java Matcher<\/h2>\n<p>The Matcher class in Java is a part of the java.util.regex package and it works in conjunction with the Pattern class for pattern matching operations on text using regular expressions.<\/p>\n<h3>Understanding the Pattern and Matcher Classes<\/h3>\n<p>Firstly, we create a <code>Pattern<\/code> object which defines the regular expression we want to search for. The <code>Pattern<\/code> class has a method called <code>compile(String regex)<\/code> which compiles the given regular expression into a pattern.<\/p>\n<p>Next, we use the <code>Pattern<\/code> object to create a <code>Matcher<\/code> object. This is done using the <code>matcher(CharSequence input)<\/code> method in the <code>Pattern<\/code> class. This method creates a matcher that will match the given input against the pattern.<\/p>\n<pre><code class=\"language-java line-numbers\">Pattern pattern = Pattern.compile(\"abc\");\nMatcher matcher = pattern.matcher(\"abcdefabc\");\n<\/code><\/pre>\n<p>In this code block, we&#8217;re looking for the pattern <code>\"abc\"<\/code> in the string <code>\"abcdefabc\"<\/code>.<\/p>\n<h3>Finding Matches with Matcher<\/h3>\n<p>Once we have our <code>Matcher<\/code> object, we can use various methods to find matches and retrieve the matched segments. The <code>find()<\/code> method is commonly used to find the next match in the input sequence.<\/p>\n<pre><code class=\"language-java line-numbers\">while (matcher.find()) {\n    System.out.println(\"Found match at: \" + matcher.start() + \" to \" + matcher.end());\n}\n\n\/\/ Output:\n\/\/ Found match at: 0 to 3\n\/\/ Found match at: 6 to 9\n<\/code><\/pre>\n<p>In this example, <code>find()<\/code> is used in a while loop to find all matches in the input sequence. For each match, it prints the start and end indices of the match in the input sequence.<\/p>\n<p>The Matcher class offers a powerful and flexible way to search for patterns in text. However, it&#8217;s important to remember that the <code>find()<\/code> method will only find non-overlapping matches. For overlapping matches, you&#8217;ll need to use different techniques, which we&#8217;ll cover in the advanced usage section.<\/p>\n<p>In the next section, we&#8217;ll delve into more complex uses of the Matcher class, exploring different methods and their applications.<\/p>\n<h2>Advanced Techniques with Java Matcher<\/h2>\n<p>As you become more comfortable with the Matcher class, you&#8217;ll find there are several methods that allow for more complex pattern matching. Let&#8217;s explore three of these methods: <code>matches()<\/code>, <code>lookingAt()<\/code>, and <code>find()<\/code>.<\/p>\n<h3>The matches() Method<\/h3>\n<p>The <code>matches()<\/code> method attempts to match the entire input sequence against the pattern.<\/p>\n<pre><code class=\"language-java line-numbers\">Pattern pattern = Pattern.compile(\"abc\");\nMatcher matcher = pattern.matcher(\"abcdef\");\nboolean matchFound = matcher.matches();\n\n\/\/ Output:\n\/\/ false\n<\/code><\/pre>\n<p>In this example, <code>matches()<\/code> returns <code>false<\/code> because it tries to match the entire string <code>\"abcdef\"<\/code> against the pattern <code>\"abc\"<\/code>, which is not a complete match.<\/p>\n<h3>The lookingAt() Method<\/h3>\n<p>The <code>lookingAt()<\/code> method attempts to match the input sequence, starting at the beginning, against the pattern.<\/p>\n<pre><code class=\"language-java line-numbers\">Pattern pattern = Pattern.compile(\"abc\");\nMatcher matcher = pattern.matcher(\"abcdef\");\nboolean matchFound = matcher.lookingAt();\n\n\/\/ Output:\n\/\/ true\n<\/code><\/pre>\n<p>Here, <code>lookingAt()<\/code> returns <code>true<\/code> because the beginning of the string <code>\"abcdef\"<\/code> matches the pattern <code>\"abc\"<\/code>.<\/p>\n<h3>The find() Method Revisited<\/h3>\n<p>We&#8217;ve already discussed the <code>find()<\/code> method, but it&#8217;s worth revisiting. Unlike <code>matches()<\/code> and <code>lookingAt()<\/code>, <code>find()<\/code> doesn&#8217;t require the match to be at the beginning of the string. It can find the pattern anywhere in the string.<\/p>\n<pre><code class=\"language-java line-numbers\">Pattern pattern = Pattern.compile(\"abc\");\nMatcher matcher = pattern.matcher(\"abcdefabc\");\nwhile (matcher.find()) {\n    System.out.println(\"Found match at: \" + matcher.start() + \" to \" + matcher.end());\n}\n\n\/\/ Output:\n\/\/ Found match at: 0 to 3\n\/\/ Found match at: 6 to 9\n<\/code><\/pre>\n<p>In this example, <code>find()<\/code> finds two matches for the pattern <code>\"abc\"<\/code> in the string <code>\"abcdefabc\"<\/code>.<\/p>\n<blockquote><p>\n  Each of these methods has its uses, and understanding which one to use in a given situation can greatly enhance your pattern matching abilities with the Matcher class. In the next section, we&#8217;ll discuss alternative approaches and when they might be more appropriate.\n<\/p><\/blockquote>\n<h2>Exploring Alternative Approaches<\/h2>\n<p>While the Java Matcher class is a powerful tool for pattern matching, there are other methods and classes that can be used for similar tasks. Let&#8217;s explore some of these alternatives.<\/p>\n<h3>Using Pattern.split()<\/h3>\n<p>The <code>Pattern.split(CharSequence input)<\/code> method splits the given input sequence around matches of the pattern.<\/p>\n<pre><code class=\"language-java line-numbers\">Pattern pattern = Pattern.compile(\"a\");\nString[] result = pattern.split(\"abcabc\");\nfor (String str : result) {\n    System.out.println(str);\n}\n\n\/\/ Output:\n\/\/ ''\n\/\/ 'bc'\n\/\/ 'bc'\n<\/code><\/pre>\n<p>In this example, the input string <code>\"abcabc\"<\/code> is split around matches of the pattern <code>\"a\"<\/code>. The <code>split()<\/code> method returns an array of strings computed by splitting the input around matches of the pattern.<\/p>\n<h3>Using String.matches()<\/h3>\n<p>The <code>String.matches(String regex)<\/code> method tells whether or not the string matches the given regular expression.<\/p>\n<pre><code class=\"language-java line-numbers\">boolean matchFound = \"abcdef\".matches(\"abc.*\");\n\n\/\/ Output:\n\/\/ true\n<\/code><\/pre>\n<p>In this example, <code>matches()<\/code> returns <code>true<\/code> because the string <code>\"abcdef\"<\/code> matches the regular expression <code>\"abc.*\"<\/code>.<\/p>\n<h3>Using Apache Commons Lang<\/h3>\n<p>Third-party libraries like Apache Commons Lang offer utilities for working with regular expressions. For example, <code>StringUtils.containsAny(CharSequence sequence, CharSequence... searchSequences)<\/code> checks if any of the <code>searchSequences<\/code> are found in the <code>sequence<\/code>.<\/p>\n<pre><code class=\"language-java line-numbers\">boolean matchFound = StringUtils.containsAny(\"abcdef\", \"abc\", \"xyz\");\n\n\/\/ Output:\n\/\/ true\n<\/code><\/pre>\n<p>In this example, <code>containsAny()<\/code> returns <code>true<\/code> because the sequence <code>\"abcdef\"<\/code> contains the search sequence <code>\"abc\"<\/code>.<\/p>\n<blockquote><p>\n  These alternative approaches can be more suitable in certain scenarios. For example, <code>Pattern.split()<\/code> can be used for tokenizing a string, <code>String.matches()<\/code> can be used for simple pattern matching tasks, and Apache Commons Lang can be used for more complex pattern matching tasks. Understanding these alternatives and when to use them can greatly enhance your pattern matching abilities.\n<\/p><\/blockquote>\n<h2>Overcoming Obstacles with Java Matcher<\/h2>\n<p>While using the Matcher class, you might encounter some common errors or obstacles. Let&#8217;s discuss these issues and their solutions, along with some best practices for optimization.<\/p>\n<h3>Dealing with No Match Found Exception<\/h3>\n<p>A common error occurs when you try to use match information methods (like <code>start()<\/code>, <code>end()<\/code>, <code>group()<\/code>) without first ensuring that a match exists. This will result in a <code>IllegalStateException<\/code>.<\/p>\n<pre><code class=\"language-java line-numbers\">try {\n    Pattern pattern = Pattern.compile(\"abc\");\n    Matcher matcher = pattern.matcher(\"def\");\n    System.out.println(matcher.group());\n} catch (IllegalStateException e) {\n    System.out.println(\"No match found.\");\n}\n\n\/\/ Output:\n\/\/ No match found.\n<\/code><\/pre>\n<p>In this example, we&#8217;re trying to get the matched group before calling a method like <code>find()<\/code> or <code>matches()<\/code> to ensure a match exists. To avoid this error, always ensure a match exists before trying to retrieve match information.<\/p>\n<h3>Considerations for Pattern Complexity<\/h3>\n<p>The complexity of your pattern can significantly impact the performance of your matching operation. Avoid overly complex patterns with excessive quantifiers or unnecessary groups. If performance is a concern, consider using simpler patterns or alternative methods for string processing.<\/p>\n<h3>Using find() Correctly<\/h3>\n<p>Remember that the <code>find()<\/code> method resets its internal state each time it&#8217;s called. If you call <code>find()<\/code> again after finding a match, it will continue searching from where it left off, not from the beginning of the input sequence.<\/p>\n<pre><code class=\"language-java line-numbers\">Pattern pattern = Pattern.compile(\"abc\");\nMatcher matcher = pattern.matcher(\"abcdefabc\");\nif (matcher.find()) {\n    System.out.println(\"Found match at: \" + matcher.start() + \" to \" + matcher.end());\n}\nif (matcher.find()) {\n    System.out.println(\"Found match at: \" + matcher.start() + \" to \" + matcher.end());\n}\n\n\/\/ Output:\n\/\/ Found match at: 0 to 3\n\/\/ Found match at: 6 to 9\n<\/code><\/pre>\n<p>In this example, we call <code>find()<\/code> twice. Each call to <code>find()<\/code> continues searching from where the last match ended, not from the beginning of the string.<\/p>\n<blockquote><p>\n  Understanding these common obstacles and their solutions, along with these considerations, can help you use the Matcher class more effectively and efficiently.\n<\/p><\/blockquote>\n<h2>Understanding Regular Expressions<\/h2>\n<p>Regular expressions, often abbreviated as regex, are sequences of characters that form a search pattern. These patterns are used to match character combinations in strings, making them a crucial tool in text processing.<\/p>\n<p>In Java, regular expressions are implemented through the <code>Pattern<\/code> and <code>Matcher<\/code> classes in the <code>java.util.regex<\/code> package. The <code>Pattern<\/code> class encapsulates the compiled version of a regular expression, while the <code>Matcher<\/code> class interprets the pattern and performs match operations on a character sequence.<\/p>\n<pre><code class=\"language-java line-numbers\">Pattern pattern = Pattern.compile(\"abc\");\nMatcher matcher = pattern.matcher(\"abcdefabc\");\nwhile (matcher.find()) {\n    System.out.println(\"Found match at: \" + matcher.start() + \" to \" + matcher.end());\n}\n\n\/\/ Output:\n\/\/ Found match at: 0 to 3\n\/\/ Found match at: 6 to 9\n<\/code><\/pre>\n<p>In this example, we&#8217;re creating a <code>Pattern<\/code> object with the pattern <code>\"abc\"<\/code>, then creating a <code>Matcher<\/code> object from that pattern. The <code>find()<\/code> method is used in a loop to find all occurrences of the pattern in the input string.<\/p>\n<h2>The Relationship Between Pattern and Matcher<\/h2>\n<p>The <code>Pattern<\/code> and <code>Matcher<\/code> classes work closely together to perform regex operations. The <code>Pattern<\/code> class represents the regular expression, while the <code>Matcher<\/code> class uses a <code>Pattern<\/code> object to perform matching operations on an input string.<\/p>\n<p>It&#8217;s important to note that a <code>Matcher<\/code> object can only work with one pattern and one input sequence. If you need to match against a different pattern or on a different input sequence, you&#8217;ll need to create a new <code>Matcher<\/code> object.<\/p>\n<h2>Broader Concepts<\/h2>\n<p>Understanding regular expressions and the <code>Pattern<\/code> and <code>Matcher<\/code> classes is just the tip of the iceberg when it comes to text processing in Java. Other related classes, like <code>String<\/code>, <code>StringBuilder<\/code>, and <code>StringBuffer<\/code>, offer additional methods for manipulating and processing text.<\/p>\n<p>Furthermore, third-party libraries like Apache Commons Lang and Google Guava provide even more powerful tools for text processing. But no matter what tools you use, the fundamental concepts of pattern matching and regular expressions remain the same.<\/p>\n<h2>Applying Java Matcher in Real-World Projects<\/h2>\n<p>The Java Matcher class is not just a theoretical concept, but a practical tool that can be used in various real-world applications.<\/p>\n<h3>Data Validation<\/h3>\n<p>One of the most common uses of the Matcher class is in data validation. By defining a pattern for valid data, you can use a Matcher to check if a given input matches the pattern. This can be used, for example, to validate user inputs such as email addresses, phone numbers, or passwords.<\/p>\n<pre><code class=\"language-java line-numbers\">Pattern pattern = Pattern.compile(\"^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}$\");\nMatcher matcher = pattern.matcher(\"user@example.com\");\nif (matcher.matches()) {\n    System.out.println(\"Valid email address.\");\n} else {\n    System.out.println(\"Invalid email address.\");\n}\n\n\/\/ Output:\n\/\/ Valid email address.\n<\/code><\/pre>\n<p>In this example, we use a regular expression to define a pattern for a valid email address. The Matcher then checks if the input string matches this pattern.<\/p>\n<h3>Text Parsing<\/h3>\n<p>The Matcher class can also be used for text parsing tasks. For example, you can use it to extract specific information from a larger text, such as finding all URLs in a webpage.<\/p>\n<pre><code class=\"language-java line-numbers\">Pattern pattern = Pattern.compile(\"(http:\/\/|https:\/\/)[a-zA-Z0-9.-]+(\/[a-zA-Z0-9.%&amp;=]*)?\");\nMatcher matcher = pattern.matcher(\"Visit us at http:\/\/www.example.com or at https:\/\/blog.example.com\");\nwhile (matcher.find()) {\n    System.out.println(\"URL found: \" + matcher.group());\n}\n\n\/\/ Output:\n\/\/ URL found: http:\/\/www.example.com\n\/\/ URL found: https:\/\/blog.example.com\n<\/code><\/pre>\n<p>In this example, we define a pattern for URLs and use the Matcher to find all URLs in a text.<\/p>\n<h2>Accompanying Classes and Methods<\/h2>\n<p>The Matcher class often doesn&#8217;t work alone. It&#8217;s usually used together with other classes and methods from the <code>java.util.regex<\/code> package or even from third-party libraries. For example, the <code>Pattern<\/code> class is almost always used together with the Matcher class. Other related classes include <code>PatternSyntaxException<\/code> and <code>MatchResult<\/code>.<\/p>\n<h3>Further Resources for Mastering Java Matcher<\/h3>\n<p>To continue your journey in mastering the Java Matcher class and related topics, here are some resources that offer more in-depth information:<\/p>\n<ul>\n<li><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/blog\/java-string\/\">Mastery Step-by-Step: Strings in Java<\/a> &#8211; Discover techniques for encoding and decoding strings in Java.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/blog\/java-pattern\/\">Java Pattern Basics<\/a> &#8211; Understand how to create Pattern objects and use them for pattern matching operations.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/ioflood.com\/blog\/java-string-methods\/\">Java String Functions<\/a> &#8211; Learn about various string operations such as concatenation, and substring extraction.<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/docs.oracle.com\/javase\/tutorial\/essential\/regex\/\" target=\"_blank\" rel=\"noopener\">Oracle&#8217;s Java Documentation on Regular Expressions<\/a> &#8211; Direct insights on working with regular expressions in Java.<\/p>\n<\/li>\n<li>\n<p>Baeldung&#8217;s <a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.baeldung.com\/regular-expressions-java\" target=\"_blank\" rel=\"noopener\">Guide on Java Regex<\/a> explores navigating regular expressions in Java.<\/p>\n<\/li>\n<li>\n<p>GeeksforGeeks&#8217; <a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.geeksforgeeks.org\/regular-expressions-in-java\/\" target=\"_blank\" rel=\"noopener\">Java Regex Tutorial<\/a> teaches how to implement Java regular expressions efficiently.<\/p>\n<\/li>\n<\/ul>\n<p>These resources offer comprehensive guides on Java&#8217;s regular expressions, including the Matcher and Pattern classes, and provide a deeper understanding of their usage and applications.<\/p>\n<h2>Wrapping Up: Mastering the Java Matcher Class<\/h2>\n<p>In this comprehensive guide, we&#8217;ve delved into the depths of the Java Matcher class, a powerful tool for pattern matching in Java.<\/p>\n<p>We began with the basics, understanding how to use the Matcher class in conjunction with the Pattern class to find patterns in data. We then explored more advanced techniques, such as using different methods like <code>matches()<\/code>, <code>lookingAt()<\/code>, and <code>find()<\/code>, each with its own unique use case.<\/p>\n<p>We also discussed alternative approaches, such as using <code>Pattern.split()<\/code>, <code>String.matches()<\/code>, or third-party libraries like Apache Commons Lang. Each of these alternatives offers unique advantages and can be more suitable in certain scenarios.<\/p>\n<p>Along the way, we tackled common obstacles and their solutions when using the Matcher class, providing tips for best practices and optimization. We also delved into the background and fundamentals of regular expressions, the relationship between the Pattern and Matcher classes, and broader concepts related to text processing in Java.<\/p>\n<p>Here&#8217;s a quick comparison of the methods we&#8217;ve discussed:<\/p>\n<table>\n<thead>\n<tr>\n<th>Method<\/th>\n<th>Uses<\/th>\n<th>Pros<\/th>\n<th>Cons<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>matches()<\/td>\n<td>Matches the entire input sequence<\/td>\n<td>Precise<\/td>\n<td>Not flexible<\/td>\n<\/tr>\n<tr>\n<td>lookingAt()<\/td>\n<td>Matches the beginning of the input sequence<\/td>\n<td>Flexible<\/td>\n<td>Limited scope<\/td>\n<\/tr>\n<tr>\n<td>find()<\/td>\n<td>Finds the pattern anywhere in the sequence<\/td>\n<td>Most flexible<\/td>\n<td>Might require more processing power<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Whether you&#8217;re just starting out with the Matcher class or looking to level up your pattern matching skills, we hope this guide has given you a deeper understanding of the Matcher class and its capabilities.<\/p>\n<p>With its balance of flexibility, power, and precision, the Matcher class is a valuable tool for pattern matching in Java. Now, you&#8217;re well equipped to harness its power. Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Are you finding it challenging to work with the Java Matcher class? You&#8217;re not alone. Many developers find themselves puzzled when it comes to handling pattern matching in Java, but we&#8217;re here to help. Think of the Java Matcher class as a detective &#8211; it helps you find patterns in your data, providing a versatile [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":8742,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[154,121],"tags":[],"class_list":["post-5898","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","category-programming-coding","cat-154-id","cat-121-id","has_thumb"],"_links":{"self":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/5898","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/comments?post=5898"}],"version-history":[{"count":14,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/5898\/revisions"}],"predecessor-version":[{"id":17655,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/posts\/5898\/revisions\/17655"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/media\/8742"}],"wp:attachment":[{"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/media?parent=5898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/categories?post=5898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ioflood.com\/blog\/wp-json\/wp\/v2\/tags?post=5898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}