[Tutor] Question about an re

Kent Johnson kent37 at tds.net
Sat Oct 29 00:34:30 CEST 2005


w chun wrote:
>>- ->: \d+/?\d*
>>- ->
>>- ->ie 1 or more digits followed by 0 or 1 slashes followed by 0 or more digits.
> 
> 
> 
> this looks like it'll also accept invalid data, such as "1/" ... i
> think there's some more tweaking involved to get it so that if there's
> a '/', there is at least one digit afterwards.

\d+(/\d+)?

Kent



More information about the Tutor mailing list