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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...