in reply to Find the word????
You need to be clearer about the rules that define what you actually want to extract from the line. For example, this does what you asked, but almost certainly isn't what you want:
$_ = 'samir: 23 yearold'; my $match $match = $1 if /(samir: 23)/;
Maybe you want something more like this:
$_ = 'samir: 23 yearold'; my $match $match = $1 if /(\w+:\s+\d+)/;
But without knowing what your rules are, there's no way we can really help.
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|