Following [this question](https://stackoverflow.com/questions/7240617/regex-to-fetch-xml-node-string-value) it gives me just 1st match. I want to get all the matching into a string or a string array

This is my part of output from which I need to extract all `Category`'s

```
<Trace Enabled="false">
        <ActiveCategories>
            <Category>ENVIRONMENT</Category>
            <Category>EXEC</Category>
            <Category>EXTERNALS</Category>
            <Category>FILESYSTEM</Category>
            <Category>INPUT_DOC</Category>
            <Category>INTERFACES</Category>
            <Category>NETWORKING</Category>
            <Category>OUTPUT_DOC</Category>
            <Category>PREPROCESSOR_INPUT</Category>
            <Category>REQUEST</Category>
            <Category>SYSTEMRESOURCES</Category>
            <Category>VIEWIO</Category>
            <Category>ALL</Category>
        </ActiveCategories>
        <SeverityLevel>ERROR</SeverityLevel>
        <MessageInfo>
            <ProcessAndThreadIds>true</ProcessAndThreadIds>
            <TimeStamp>true</TimeStamp>
        </MessageInfo>
        <TraceFile>
            <FileName>CMDS_log.txt</FileName>
            <MaxFileSize>1000000</MaxFileSize>
            <RecyclingMethod>Restart</RecyclingMethod>
        </TraceFile>
    </Trace>

```

right now through the below code I am only able to fetch `ENVIRONMENT`, I need to fetch all of the `Category`'s value

```
def regexFinder(String myInput,String myRegex)
{
String ResultString
Pattern regex
Matcher regexMatcher

regex = Pattern.compile(myRegex, Pattern.DOTALL);
regexMatcher = regex.matcher(myInput);
if (regexMatcher.find()) {
    ResultString = regexMatcher.group();
}
}

tempResultString=regexFinder(ResultString,"(?<=<Category>)(?:(?!</Category>).)*")
    csm.cmengine_category(tempResultString)
    {           "${rs}"     }

```