<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: RegEx Match Help in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574008#M47092</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; Thank you.&lt;BR /&gt;By changing the logic, do you mean something like this.. ?&lt;BR /&gt;&lt;BR /&gt;======&lt;BR /&gt;function isFieldValid(userInput) {&lt;BR /&gt;console.log(userInput)&lt;BR /&gt;var res = userInput.match(^\s|\"|\s$);&lt;BR /&gt;if (res == null)&lt;BR /&gt;return true;&lt;BR /&gt;else&lt;BR /&gt;return false;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Nov 2021 12:54:14 GMT</pubDate>
    <dc:creator>zacksoft_wf</dc:creator>
    <dc:date>2021-11-08T12:54:14Z</dc:date>
    <item>
      <title>RegEx Match Help</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574003#M47089</link>
      <description>&lt;P&gt;I have a javascript that I will be invoking from a dashboard to perform validation on a field input of user input, such that the&lt;STRONG&gt; field shouldn't contain any doublequotes&lt;/STRONG&gt; OR &lt;STRONG&gt;shouldn't contain any padded spaces in the beginning or the end of the string&lt;/STRONG&gt;.&amp;nbsp; Need help with the regex to match the above condition.&lt;BR /&gt;&lt;BR /&gt;The script looks like this ,&lt;BR /&gt;&lt;BR /&gt;&amp;lt;form script="field_validation.js"&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Url Validation&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;fieldset submitButton="false"&amp;gt;&lt;BR /&gt;&amp;lt;input type="text" token="tkn_fld" id="tkn_fld_id"&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;URL&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;/input&amp;gt;&lt;BR /&gt;&amp;lt;/fieldset&amp;gt;&lt;BR /&gt;&amp;lt;/form&amp;gt;&lt;BR /&gt;====================================&lt;/P&gt;&lt;P&gt;field_validation.js&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;require([&lt;BR /&gt;'underscore',&lt;BR /&gt;'splunkjs/mvc',&lt;BR /&gt;'jquery',&lt;BR /&gt;"splunkjs/mvc/simplexml/ready!"&lt;BR /&gt;], function(_, mvc, $) {&lt;BR /&gt;var tkn_url = splunkjs.mvc.Components.getInstance("tkn_fld_id");&amp;nbsp;&lt;BR /&gt;tkn_fld.on("change", function(e) {&lt;BR /&gt;console.log(e)&lt;BR /&gt;// e.preventDefault();&lt;BR /&gt;if (!isUrlValid(e)) {&lt;BR /&gt;alert("Enter Valid URL")&lt;BR /&gt;return false;&lt;BR /&gt;}&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;function isUrlValid(userInput) {&lt;BR /&gt;console.log(userInput)&lt;BR /&gt;var res = userInput.match( &lt;STRONG&gt;NEED HELP TO WRITE THE REGEX HERE&lt;/STRONG&gt; );&lt;BR /&gt;if (res == null)&lt;BR /&gt;return false;&lt;BR /&gt;else&lt;BR /&gt;return true;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;})&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 12:20:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574003#M47089</guid>
      <dc:creator>zacksoft_wf</dc:creator>
      <dc:date>2021-11-08T12:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Match Help</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574006#M47091</link>
      <description>&lt;P&gt;It might be easier to change your logic around and look for spaces at the beginning, spaces at the end or double quotes, and if you get a match return false.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(^\s|\"|\s$)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 08 Nov 2021 12:47:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574006#M47091</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-11-08T12:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Match Help</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574008#M47092</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; Thank you.&lt;BR /&gt;By changing the logic, do you mean something like this.. ?&lt;BR /&gt;&lt;BR /&gt;======&lt;BR /&gt;function isFieldValid(userInput) {&lt;BR /&gt;console.log(userInput)&lt;BR /&gt;var res = userInput.match(^\s|\"|\s$);&lt;BR /&gt;if (res == null)&lt;BR /&gt;return true;&lt;BR /&gt;else&lt;BR /&gt;return false;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 12:54:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574008#M47092</guid>
      <dc:creator>zacksoft_wf</dc:creator>
      <dc:date>2021-11-08T12:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Match Help</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574011#M47093</link>
      <description>&lt;P&gt;Perhaps more like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var res = userInput.match("(^\s|\"|\s$)")&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 08 Nov 2021 13:06:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574011#M47093</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-11-08T13:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Match Help</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574020#M47095</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Sorry for the bother, But could you have a quick glance if the logic is okay, with the added regex.Please !&lt;BR /&gt;&lt;BR /&gt;===========================&lt;/P&gt;&lt;P&gt;require([&lt;BR /&gt;'underscore',&lt;BR /&gt;'splunkjs/mvc',&lt;BR /&gt;'jquery',&lt;BR /&gt;"splunkjs/mvc/simplexml/ready!"&lt;BR /&gt;], function(_, mvc, $) {&lt;BR /&gt;var tkn_value = splunkjs.mvc.Components.getInstance("tkn_value_id");&lt;BR /&gt;tkn_value.on("change", function(e) {&lt;BR /&gt;console.log(e)&lt;BR /&gt;// e.preventDefault();&lt;BR /&gt;if (!isValueValid(e)) {&lt;BR /&gt;alert("Enter Valid Value")&lt;BR /&gt;return false;&lt;BR /&gt;}&lt;BR /&gt;})&lt;/P&gt;&lt;P&gt;function isValueValid(userInput) {&lt;BR /&gt;console.log(userInput)&lt;BR /&gt;var res = userInput.match("(^\s|\"|\s$)");&lt;BR /&gt;if (res == null)&lt;BR /&gt;return true;&lt;BR /&gt;else&lt;BR /&gt;return false;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;})&lt;/P&gt;&lt;P&gt;==================================&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 13:45:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574020#M47095</guid>
      <dc:creator>zacksoft_wf</dc:creator>
      <dc:date>2021-11-08T13:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Match Help</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574022#M47097</link>
      <description>&lt;P&gt;It looks right to me but bear in mind, I don't know the syntax for javascript.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 13:58:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574022#M47097</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-11-08T13:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Match Help</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574157#M47102</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;I tested the regex,&amp;nbsp;&lt;BR /&gt;It matches when it finds a doublequote ,&lt;BR /&gt;but&amp;nbsp; it cannot match spaces in the beginning or end.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;var res = userInput.match("(^\s|\"|\s$)");&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 10:16:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574157#M47102</guid>
      <dc:creator>zacksoft_wf</dc:creator>
      <dc:date>2021-11-09T10:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Match Help</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574158#M47103</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var res = userInput.match(/(^\s|\"|\s$)/g)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 09 Nov 2021 10:25:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574158#M47103</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-11-09T10:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx Match Help</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574159#M47104</link>
      <description>&lt;P&gt;Thank you so much.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 10:35:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/RegEx-Match-Help/m-p/574159#M47104</guid>
      <dc:creator>zacksoft_wf</dc:creator>
      <dc:date>2021-11-09T10:35:57Z</dc:date>
    </item>
  </channel>
</rss>

