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/

-- 
munin plugin suppresses numbers from VM names
https://bugs.launchpad.net/bugs/534397
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to