dpiquet / pve-monitor

pve-monitor is a tool to monitor hypervisor and virtual machines in a proxmox cluster
37 stars 24 forks source link

Problem with node name regexp #3

Closed clancyian closed 11 years ago

clancyian commented 11 years ago

Hi Damien, I've come accross an issue in the regular expression used to parse node names . My cluster node names contain the '-' character which is not contained in \w . \w Match "word" character (alphanumeric plus "_") \S Match non-whitespace character So , on line 281 i had to replace if ( $objLine =~ m/([\w.]+)\s+([\w.]+)(\s+([\w.]+))?/i ) { with if ( $objLine =~ m/([\w.]+)\s+([\S.]+)(\s+([\w.]+))?/i ) {

This works for me but i'm not sure if it breaks anything else :) Rgds Ian

dpiquet commented 11 years ago

Hi Ian,

Your solution won't break anything. I will correct my regexes following your advices. As i used spaces to delimiter fields, I think we can use \S everywhere. I will patch this very soon.

Thanks for your help.

Damien