regexp expression question

Sean 'Shaleh' Perry shaleh at valinux.com
Wed Apr 4 14:02:41 EDT 2001


On 04-Apr-2001 Bruce Edge wrote:
> While I'm scouring the re docs and trying variations,
> anyone have a regexp to parse the following:
> 
> Up to 3 delimited digits, with one one required, eg:
> 
> 77 or 6/77 or 555/6/77
> 

parse this with:

'^\d+(\/\d+){0,2}$'

the {0,2} means match the item in parens 0, 1, or 2 times.




More information about the Python-list mailing list