On Mon, Mar 08, 2010 at 02:02:14PM -0000, Bernie Innocenti wrote: > The valid regex should be [A-Za-z0-9_] (with numbers included).
Not exactly. According to
http://munin-monitoring.org/wiki/notes_on_datasource_names
these two should do it:
s/^[^A-Za-z_]/_/ s/[^A-Za-z0-9_]/_/g
> Also, the entire canonicalize() function could be replaced with just one > line: > > tr/A-Za-z0-9/_/c > > or even > > s/[^A-Za-z0-9]/_/g > > > Perl's eclecticism :-)
Well, yeah, except this is Python :)
-- Soren Hansen Ubuntu Developer http://www.ubuntu.com/
On Mon, Mar 08, 2010 at 02:02:14PM -0000, Bernie Innocenti wrote:
> The valid regex should be [A-Za-z0-9_] (with numbers included).
Not exactly. According to
http:// munin-monitorin g.org/wiki/ notes_on_ datasource_ names
these two should do it:
s/^[^A-Za-z_]/_/
s/[^A-Za-z0-9_]/_/g
> Also, the entire canonicalize() function could be replaced with just one
> line:
>
> tr/A-Za-z0-9/_/c
>
> or even
>
> s/[^A-Za-z0-9]/_/g
>
>
> Perl's eclecticism :-)
Well, yeah, except this is Python :)
-- www.ubuntu. com/
Soren Hansen
Ubuntu Developer
http://