summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schmitt <david.schmitt@puppetlabs.com>2015-05-30 14:33:27 +0100
committerDavid Schmitt <david.schmitt@puppetlabs.com>2015-05-30 14:33:27 +0100
commit1ae9058518d042ea81d42f46cebbb040b35a2b4d (patch)
tree738e99597194956777b0d872046c3d0fffce86da
parent4a8c0a57f2c4df4e2e3fa37466f02a7f6fccd517 (diff)
parent687600c30cb4279c36215517c02ee8e5e7c0d3cd (diff)
downloadpuppet-stdlib-1ae9058518d042ea81d42f46cebbb040b35a2b4d.tar.gz
puppet-stdlib-1ae9058518d042ea81d42f46cebbb040b35a2b4d.tar.bz2
Merge pull request #465 from igalic/patch-1
simplify mac address regex
-rw-r--r--lib/puppet/parser/functions/is_mac_address.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/parser/functions/is_mac_address.rb b/lib/puppet/parser/functions/is_mac_address.rb
index 1b3088a..2619d44 100644
--- a/lib/puppet/parser/functions/is_mac_address.rb
+++ b/lib/puppet/parser/functions/is_mac_address.rb
@@ -15,7 +15,7 @@ Returns true if the string passed to this function is a valid mac address.
mac = arguments[0]
- if /^[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}:[a-fA-F0-9]{1,2}$/.match(mac) then
+ if /^[a-f0-9]{1,2}(:[a-f0-9]{1,2}){5}$/i.match(mac) then
return true
else
return false