@Michael ,
I will briefly explain my regex: but really, you should look at the documentation I linked you to.
FULL: (?s)^(\d+\.\d+.*?$).*(<status>.*?</status>).*?</x-cisco-remotecc-request>
(?s) = turns on “. matches newline”
^ = starts the match at the beginning of a line
(\d+\.\d+.*?$) = looks for one or more digit, then a decimal point, then one or more digit, followed by everything to the end of the line, and because of the parentheses, puts it all into group #1 (referenced later as $1)
.* = matches 0 or more characters, including the newline – hence, this allows it to match multiple lines at once
(<status>.*?</status>) matches <status> and </status> surrounding text, and puts that unit into group #2 (referenced later as $2)
.*?</x-cisco-remotecc-request> = finds all the characters up to and including the next </x-cisco-remotecc-request> closing tag
Replacement: $1 $2 = replace everything matched above (from the beginning of the first line in the match all the way to </x-cisco-remotecc-request>) with just the contents of group 1, followed by a space, followed by contents of group 2.
i do not understand how you go down all rows, till you find the value mentioned by <status>. what is the key operator for this?
The .* when . matches newline or (?s) is enabled will match 0 or more characters including newlines, hence it can capture multiple lines between
Status could be even on
My regular expression handled that, because it accepted anything between the <status> and </status>, and put that into a group; Guy’s regex ignored your actual status portion, and just always replaced it with <status>off</status> (because your example only showed one value, and he assumed that you always wanted to convert the status to off because of the way you phrased things)