Hello All,
Would like to know what is wrong with the code (below) that I wrote to extract group of lines that match a set of patterns (including the lines that match the pattern)
code is here:
if ($_ =~ /^E/gi || $_ =~ /gmake.*/gi) { push (@errors, $_) }
and the lines from which I need to extract text is here:
I have updated since the lines do not start with that special character (carat) at the line beginning (as posted intially)
E : abcdfcsds 1387382 43243 ijigje jg445 3u4 (53545545) E : abcdfcsds 1387382 43243 ijigje jg445 3u4 (53545545) E : abcdfcsds 1387382 43243 ijigje jg445 3u4 (53545545) E : abcdfcsds 1387382 43243 ijigje jg445 3u4 (53545545) E : abcdfcsds 1387382 43243 ijigje jg445 3u4 (53545545) gmake : **** build failed fdjgu43uffer Error 1
With this code, am able to extract the last line only (i.e. the one starts with ^E).
Could anyone tell me what is wrong with regular expression ?
thanks in advance
/Ram
Edited by planetscape - swapped out some p tags for some code tags
In reply to Extraction of set of lines using regular expression by ramthen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |