Re: Regular expression for years after a given one

"A. Pagaltzis" <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <20040601154322.GA21799@klangraum>
* Tobias Wolter <[email protected]> [2004-06-01 17:33]:
> On 2004-06-01T10:52:55+0100 (Tuesday), Jose Alves de Castro wrote:
> > "How can I say that I want every single year after the one I
> > have? It's impossible..."
> 
> The > operator works quite well for a four-digit year.

Yeah, but that requires backing out of the pattern match into
Perl context, as saving the required information isn't always
easy either.

Of course you could use such a numerical comparison in a Perl
code subexpression as several people here have done, but that is
also a switch of context.

There may also be cases where the interface to some other part of
code will only allow you to pass in a pattern, not a coderef or
something else, and where re 'eval' is not enabled.

There are definitely circumstances where using a regex to do
numerical comparison is the best option.

And anyway, did you notice what this list is called?

-- 
Regards,
Aristotle
 
"If you can't laugh at yourself, you don't take life seriously enough."
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.