Search in paragraph's text: Difference between revisions

verify the presence of a word or regular expression within several paragraphs of text (structured or not)
(verify the presence of a word or regular expression within several paragraphs of text (structured or not))
 
(verify the presence of a word or regular expression within several paragraphs of text (structured or not))
Line 5:
So here, let’s imagine that we are trying to verify the presence of a keyword "SystemError" within the paragraphs "Traceback (most recent call last):" in the file Traceback.txt
 
<pre>
cat Traceback.txt :
 
Line 75 ⟶ 76:
reason = 'Unable to complete Sysinfo operation. Please see the VMkernel log file for more details.: Sysinfo error: Bad parameterSee VMkernel log for details.'
}
</pre>
 
 
The expected result must be (with ---------------- for paragraphs matched's sep) :
 
<pre>
Traceback (most recent call last):
vmodl.fault.SystemError: (vmodl.fault.SystemError) {
Line 110 ⟶ 112:
}
----------------
</pre>
40

edits