Re: Regexp to parse "Version:" fields

2006-06-21 Thread Otavio Salvador
Christoph Haas <[EMAIL PROTECTED]> writes: > On Wed, Jun 21, 2006 at 03:04:54PM +0200, Christoph Haas wrote: >> On Wed, Jun 21, 2006 at 09:15:41AM -0300, Otavio Salvador wrote: >> > Christoph Haas <[EMAIL PROTECTED]> writes: >> > >> > > So before diving into into regular expressions any further (

Re: Regexp to parse "Version:" fields

2006-06-21 Thread Otavio Salvador
Christoph Haas <[EMAIL PROTECTED]> writes: > On Wed, Jun 21, 2006 at 09:15:41AM -0300, Otavio Salvador wrote: >> Christoph Haas <[EMAIL PROTECTED]> writes: >> >> > So before diving into into regular expressions any further (I have no >> > practical experience with lookahead patterns for example)

Re: Regexp to parse "Version:" fields

2006-06-21 Thread Christoph Haas
On Wed, Jun 21, 2006 at 03:04:54PM +0200, Christoph Haas wrote: > On Wed, Jun 21, 2006 at 09:15:41AM -0300, Otavio Salvador wrote: > > Christoph Haas <[EMAIL PROTECTED]> writes: > > > > > So before diving into into regular expressions any further (I have no > > > practical experience with lookahea

Re: Regexp to parse "Version:" fields

2006-06-21 Thread Brendan O'Dea
On Wed, Jun 21, 2006 at 01:56:21PM +0200, Christoph Haas wrote: >for mentors.debian.net I would like to find a perfect (TM) regular >expression to split the "Version:" line of a control file into: > > - epoch > - upstream version > - Debian package revision > >My current attempt is: > > ^(?:(\d+)

Re: Regexp to parse "Version:" fields

2006-06-21 Thread Christoph Haas
On Wed, Jun 21, 2006 at 09:15:41AM -0300, Otavio Salvador wrote: > Christoph Haas <[EMAIL PROTECTED]> writes: > > > So before diving into into regular expressions any further (I have no > > practical experience with lookahead patterns for example) I would like > > to know if anyone else has worked

Re: Regexp to parse "Version:" fields

2006-06-21 Thread Otavio Salvador
Christoph Haas <[EMAIL PROTECTED]> writes: > So before diving into into regular expressions any further (I have no > practical experience with lookahead patterns for example) I would like > to know if anyone else has worked on this. Perhaps even some Debian tool > does this parsing. I need an impl

Re: Regexp to parse "Version:" fields

2006-06-21 Thread Adam Borowski
On Wed, Jun 21, 2006 at 01:56:21PM +0200, Christoph Haas wrote: > for mentors.debian.net I would like to find a perfect (TM) regular > expression to split the "Version:" line of a control file into: > > - epoch > - upstream version > - Debian package revision > > My current attempt is: > >

Re: Regexp to parse "Version:" fields

2006-06-21 Thread Norbert Preining
On Mit, 21 Jun 2006, Christoph Haas wrote: >^(?:(\d+):)?(\d[\w\.\+-:]*?)(?:-(.+))?$ What about ending with (?:-([^-]+))?$ Best wishes Norbert --- Dr. Norbert Preining Università di Siena gpg DSA

Regexp to parse "Version:" fields

2006-06-21 Thread Christoph Haas
Hi... for mentors.debian.net I would like to find a perfect (TM) regular expression to split the "Version:" line of a control file into: - epoch - upstream version - Debian package revision My current attempt is: ^(?:(\d+):)?(\d[\w\.\+-:]*?)(?:-(.+))?$ I have extracted the version of my