"Mumia W." schreef:
> Ryan Moszynski:

>> I need to write some code to allow users to specify which of a whole
>> bunch of elements(e.g.512/1024) that they want to view.  My idea for
>> how to do this was to have them input a semicolon delimited list, for
>> example:
>>
>> 1-10;25;33;100-250
>>
>>
>> i tried using this to check to make sure they input a valid list that
>> i can process:
>> [...]
>
>      $str =~ m/^((\d+-\d+|\d+);?)+$/g;
>
> However, this does not consider 250-100 to be invalid.

Nor "10-30-20".

What's the g-modifier for?

The structure is 'a;b;c;d', the smallest is 'a', so treat the ';' as the
start of a trailer.

-- 
Affijn, Ruud

"Gewoon is een tijger."



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to