> 
> 
> 
> Hello, please can you help me. Is it possible to specify number
matching in a regex, i.e. can you have something like:
> 
> my $match =~ m/match_number_if_number_is_less_than_255/
> 
> instead of my $match =~ m/(\d{3})/;
> 
> if ($1<=255){my @array = @array +$1}?
> 

Well your example is a fairly common one and gets a lot of attention in
the Mastering Regular Expressions book (which is excellent), and
concludes with:

[01]?\d\d?|2[0-4]\d|25[0-5]

But you should really not just use this willy-nilly, if *you* don't
understand it the person coming after you (which might just be you!)
won't likely either.  So in many cases it is better to know your data,
do some pre-parsing then compare numbers using standard arithmetic as
you have shown.  The real question is "what's wrong with what you have?"

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to