Getting Data In

Modular input validation Introspection

bmacias84
Champion

Hello, I can't seem to get my validation using match. Hoping some one can tell me what I am doing wrong or missing.


<arg name="name">
<title>Device Name or IP</title>
<description>FQDN or IP Address. For example, 10.1.173.1 or INTFW-ASA700-vc.MYDomain.net.
</description>
<validation>
validate(match('name', '^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9]).){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])$'), "Device Name or IP: invalid DNS or IP")
</validation>
</arg>

Thanks in advance

1 Solution

jguarini
Path Finder

try this

(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)

gladly taken from
http://stackoverflow.com/questions/4011855/regexp-to-check-if-an-ip-is-valid

View solution in original post

jguarini
Path Finder

try this

(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)

gladly taken from
http://stackoverflow.com/questions/4011855/regexp-to-check-if-an-ip-is-valid

Get Updates on the Splunk Community!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...