regexp expression question

Bruce Edge bedge at troikanetworks.com
Wed Apr 4 13:58:47 EDT 2001


In article <20010404.103606.773319847.21458 at mead.troikanetworks.com>,
"Bruce Edge" <bedge at troikanetworks.com> 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
> 
> Thanks, Bruce.

Got it, finally. Just for the record:

 x=re.match( '^((\d+)\W)?((\d+)\W)?(\d+)$', '11/22/33'



More information about the Python-list mailing list