[tpm] Greedy regex question

John Macdonald john at perlwolf.com
Sat Mar 1 21:55:17 PST 2008


On Sat, Mar 01, 2008 at 06:49:22PM -0500, Madison Kelly wrote:
> arocker at vex.net wrote:
> >> Madi
> >>
> >>    block.minor = 0  (0x0)  (int)
> >>    volume.label = 'CentOS_5.1_Final'  (string)
> >>    volume.disc.has_data = true  (bool)
> >>    volume.ignore = false  (bool)
> >>    org.freedesktop.Hal.Device.Volume.method_names = { 'Mount',
> >> 'Unmount', 'Eject' } (string list)
> >>    info.capabilities = { 'volume.disc', 'volume', 'block' } (string list)
> >>    volume.is_partition = false  (bool)
> >>    volume.disc.capacity = 3845259264  (0xe5320000)  (uint64)
> >>    volume.mount_point = '/media/cdrom0'  (string)
> > 
> > So you want to drop the parenthesised string at the end of the line?
> > Is there any likelihood of nested parentheses in it?
> > E.g. (short (ugly) int)
> 
> Yes to the first question, Nope to the second. :)
> 
> Thanks!

s/\s*\([^)]*\)\s*$//

(which accepts trailing blanks in the input, and clean them outafter 
removing the final (stuff) chunk).

> 
> Madi
> _______________________________________________
> toronto-pm mailing list
> toronto-pm at pm.org
> http://mail.pm.org/mailman/listinfo/toronto-pm


More information about the toronto-pm mailing list