in reply to Regex for spliting
Hello ravi45722,
If I understand you correctly, you may be looking for something like this:
#! perl use strict; use warnings; my @error_fields = ( ' Error from hlr : cannot connect to smsc ', 'Error from MSc : unsubscribe error', 'No paging ', ); for my $field (@error_fields) { $field =~ / ^ (?: .*? : )? \s* (.*?) \s* $ /x; print "|$1|\n"; }
Output:
17:05 >perl 1503_SoPW.pl |cannot connect to smsc| |unsubscribe error| |No paging| 17:05 >
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|