Re: Perl match problem



"Jürgen Exner" <jurgenex@xxxxxxxxxxx> wrote:

> (untested, just to give you an idea):
>
> if (/RD(\d*)/) and $1 >= -25 and $1 <= 25) ....

Uhm, since you expect at least one digit, at most 2, and there could be a
minus sign:

/RD(-?\d\d?)/

or

/RD(-?\d{1,2})/


--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html

.



Relevant Pages

  • Re: Perl match problem
    ... > Uhm, since you expect at least one digit, at most 2, and there could ... Prev by Date: ...
    (comp.lang.perl.misc)
  • Re: Need formula to extract a numeric value from a free-format tex
    ... I needed to make one more modification to my formula to correct an area where it incorrectly missed the 7 digit number. ... Rick (MVP - Excel) ... I've seen that double minus before and never understood the point. ... would see text constructions like these 7 character long pieces of text... ...
    (microsoft.public.excel.misc)
  • Re: Need formula to extract a numeric value from a free-format tex
    ... First off, before answering your questions, here is a revised formula (the previous one could not detect an 8 or more digit number in front of the 7 digit number you wanted to find... ... Putting the double minus sign in front force Excel to attempt to multiply the text by minus one twice (--TextNumber is the same as doing this... ... So, as the array formula iterates down the text, it will would see text constructions like these 7 character long pieces of text... ...
    (microsoft.public.excel.misc)
  • Re: Automated-backup script
    ... > 1) download the backup file ... > character of file, if it is a digit, minus 1) ...
    (alt.linux)
  • Re: Help: Match Error
    ... Quoth Amy Lee: ... The minus sign is not a digit. ... All persons, living or dead, are entirely coincidental. ...
    (comp.lang.perl.misc)