<prompt> Kamba: Hii ni mfano kamba na anwani Regex: example.comKuandika Java kazi ya pato mechi zote za regex aliyopewa ndani ya kamba.  <response>: Heres an example Java function to output all matches of a given regex inside a string:import java.util.regex.Matcher;import java.util.regex.Pattern;public class RegexMatcher public static void findMatchesString input, String regex Pattern pattern Pattern.compileregex; Matcher matcher pattern.matcherinput; while matcher.find System.out.printlnMatch found: matcher.group; public static void mainString args String input This is an example string with an address String regex example.com; findMatchesinput, regex; This code defines a function called findMatches that takes the input string and regex as parameters. It then compiles the regex into a Pattern object, creates a Matcher object using the input string, and loops through all the matches using matcher.find. For each match, it prints out the matched string using matcher.group. Finally, the main method calls findMatches with the example input and regex. In this case, the output of running this code would be:Match found: example.com 