pattern match !

Asun Friere afriere at yahoo.co.uk
Wed Jul 11 01:48:24 EDT 2007


On Jul 11, 1:40 pm, hari.sir... at gmail.com wrote:
> Extract the application name with version from an RPM string like
> hpsmh-1.1.1.2-0-RHEL3-Linux.RPM, i require to extract hpsmh-1.1.1.2-0
> from above string. Sometimes the RPM string may be hpsmh-1.1.1.2-RHEL3-
> Linux.RPM.

Now that list-like splicing and indexing works on strings, why not
just splice the string, using .index to locate '-RHEL'?




More information about the Python-list mailing list