java - Regex to fetch all matching values from xml node -


After that I only get 1 match. I want to match all in a string or string array

This is part of my output, from which to me category of << p>

 < Code> & lt; Trace enabled = "wrong" & gt; & Lt; ActiveCategories & gt; & Lt; Category & gt; Environment & lt; / Category & gt; & Lt; Category & gt; EXEC & lt; / Category & gt; & Lt; Category & gt; External & lt; / Category & gt; & Lt; Category & gt; File system & lt; / Category & gt; & Lt; Category & gt; INPUT_DOC & lt; / Category & gt; & Lt; Category & gt; Interface and lt; / Category & gt; & Lt; Category & gt; Networking & lt; / Category & gt; & Lt; Category & gt; OUTPUT_DOC & lt; / Category & gt; & Lt; Category & gt; PREPROCESSOR_INPUT & lt; / Category & gt; & Lt; Category & gt; Request & lt; / Category & gt; & Lt; Category & gt; SYSTEMRESOURCES & lt; / Category & gt; & Lt; Category & gt; VIEWIO & lt; / Category & gt; & Lt; Category & gt; All & lt; / Category & gt; & Lt; / ActiveCategories & gt; & Lt; SeverityLevel & gt; Error & lt; / SeverityLevel & gt; & Lt; MessageInfo & gt; & Lt; ProcessAndThreadIds & gt; True & lt; / ProcessAndThreadIds & gt; & Lt; Timestamp & gt; True & lt; / Timestamp & gt; & Lt; / MessageInfo & gt; & Lt; Tracefile & gt; & Lt; File name & gt; CMDS_log.txt & lt; / File name & gt; & Lt; MaxFileSize & gt; 1000000 & lt; / MaxFileSize & gt; & Lt; RecyclingMethod & gt; Restart & lt; / RecyclingMethod & gt; & Lt; / Tracefile & gt; & Lt; / Trace & gt;   

By the code given below, I'm able to get only environment , I need to bring the value of all the category

  def regexFinder (string myniput, string myragax) {string result string pattern reggae matte regex meter regex = pattern. Pile (MyRegs, pattern. DOTALL); RegexMatcher = regex.matcher (myInput); If (regexMatcher.find ()) {ResultString = regexMatcher.group (); }} TempResultString = regexFinder (ResultString, "(? & Lt; = & lt; Category & gt;) (?: (?! & Lt; / category & gt;).) *") Csm.cmengine_category (tempResultString) { "$ {Rs}"}    

You .find () Repeat repeatedly on all results: Matcher regexMatcher = regex.matcher (myInput); & Lt; String & gt; MatchList = New Arrestist & lt; String & gt; (); While (regexMatcher.find ()) {matchList.add (regexMatcher.group ()); }

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -