my method above wont have problem w this ... which is a (~)one line soln to strip it out rather than a whole proc.
perhaps the qn is, not why isnt there a command to list just id, but why do you want just the index? - when most often to do anything w that index, you have to present it in the same format you ripped it from. perhaps you restructure your code so you dont have to strip out, then rebuild the component string. depends on what your doing really!
bryan's proc you present is giving you start and end components of a non-flattened component range, not sure why you posted that (no string matching in there, btw) ...perhaps you might like to look at the -fl, flatten, flag for listing?