in reply to Re^2: find one by one occurances
in thread find one by one occurances
Why do you try s/.../identify_year($1)/ge? What is that supposed to do? I thought your objective was to identify a year and the surrounding words?
If you want to know whether there is one or more occurrence of a regular expression, you can use the following idiom:
my $var = "This is the year 2000."; my @matches = ($var =~ /([0-9]{4})/g);
The regular expression I gave will only find four digits. You will need to modify that regular expression to also recognize two words before that year and two words after that year.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: find one by one occurances
by Selvakumar (Scribe) on Jul 23, 2010 at 07:11 UTC | |
by Corion (Patriarch) on Jul 23, 2010 at 07:26 UTC |