Comment 5 for bug 534397

Revision history for this message
Bernie Innocenti (codewiz) wrote : Re: [Bug 534397] [NEW] munin plugin suppresses numbers from VM names

On Wed, 2010-03-10 at 10:09 +0000, Soren Hansen wrote:
> On Wed, Mar 10, 2010 at 03:32:13AM -0000, Bernie Innocenti wrote:
> > one could reach a similar level of conciseness even in Python:
> >
> > re.sub(r"[^A-Za-z0-9]", "_", foo)
>
> No. The first character cannot be a numeral as per
>
> http://munin-monitoring.org/wiki/notes_on_datasource_names

Oh, right. Then... hmmm... we could use two alternate patterns:

 re.sub(r"^[^A-Za-z]|[^A-Za-z0-9]", "_", foo)

--
   // Bernie Innocenti - http://codewiz.org/
 \X/ Sugar Labs - http://sugarlabs.org/