<?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: Data Pattern Regex in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/data-pattern-regex/m-p/247219#M70354</link>
    <description>&lt;P&gt;The expression you've listed doesn't work the way you're intending.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;([518497|518472|518536]{6})([0-9]{10})&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The way a regex works when it comes to square brackets is a list, not a string. Every digit 1-9 is included in the three values you provided (highlighted in red below):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&lt;FONT color="#FF0000"&gt;518497&lt;/FONT&gt;|51847&lt;FONT color="#FF0000"&gt;2&lt;/FONT&gt;|51&lt;FONT color="#000000"&gt;8&lt;/FONT&gt;5&lt;FONT color="#FF0000"&gt;36&lt;/FONT&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the regex as it's written&amp;nbsp;above is essentially the same as:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;[1-9]{6}&lt;/FONT&gt;&lt;FONT color="#3366FF"&gt;[0-9]{10}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which is to say that it matches any of the following:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;111222&lt;/FONT&gt;&lt;FONT color="#3366FF"&gt;1234567890&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;999999&lt;/FONT&gt;&lt;FONT color="#3366FF"&gt;9999999999&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;537162&lt;/FONT&gt;&lt;FONT color="#3366FF"&gt;7591995601&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;FONT color="#000000"&gt;The regex to match what you want may be:&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;FONT color="#000000"&gt;518497|518472|518536[0-9]{16}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;That won't work on the firewall though&lt;/STRONG&gt;, it needs 7 non-token&amp;nbsp;characters to start the match, and the values you provided are only six characters. Additionally, you added "503441" to your first reply to &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/5300"&gt;@Brandon_Wertz&lt;/a&gt;&amp;nbsp;so there may be more you're trying to match against.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can put some of the actual strings you want to match it may help.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jan 2019 19:49:48 GMT</pubDate>
    <dc:creator>gwesson</dc:creator>
    <dc:date>2019-01-23T19:49:48Z</dc:date>
    <item>
      <title>Data Pattern Regex</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/data-pattern-regex/m-p/247056#M70325</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having trouble with the following regular expressions in PaloAlto version 7.1.21.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;(518497 | 518472 | 518536]&lt;EM&gt; &lt;STRONG&gt;{6}) ([0-9] {10})&lt;/STRONG&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;([503441] &lt;EM&gt;&lt;STRONG&gt;{6}) ([0-9] {16})&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;It works on different platforms, but not on the FW.&lt;/P&gt;&lt;P&gt;I have managed to make it work in part, in the following way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;. * ((SensitiveData) | (518497) | (518472) | (518536))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the parameters that follow do not know how to unite them.&lt;/P&gt;&lt;P&gt;Can someone give me a hand please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;{6}) ([0-9] {10}&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been almost 5 hours of mistakes, I'm frustrated.&lt;/P&gt;&lt;P&gt;help me please....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;according to the page &lt;A href="https://regex101.com/" target="_blank"&gt;https://regex101.com/&lt;/A&gt; I'm fine, but the FW Palo Alto only gives me errors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 02:03:13 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/data-pattern-regex/m-p/247056#M70325</guid>
      <dc:creator>dnahuelnir</dc:creator>
      <dc:date>2019-01-23T02:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Data Pattern Regex</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/data-pattern-regex/m-p/247163#M70336</link>
      <description>&lt;P&gt;Maybe I'm missing something, I'm not the most savvy&amp;nbsp;on writing reg ex, but what are you actually trying to accomplish?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you trying to use this in data filtering, in user-agent or somewhere else within the product?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 14:54:30 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/data-pattern-regex/m-p/247163#M70336</guid>
      <dc:creator>Brandon_Wertz</dc:creator>
      <dc:date>2019-01-23T14:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Data Pattern Regex</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/data-pattern-regex/m-p/247171#M70342</link>
      <description>&lt;P&gt;I need to block sensitive information through data filtering.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The requirement that I have is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Block all documents that contain the following regular expression:&lt;BR /&gt;• ([503441] {6}) ([0-9] {16})&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Credit card.&lt;BR /&gt;All documents that contain the following regular expression:&lt;BR /&gt;• ([518497 | 518472 | 518536] {6}) ([0-9] {10})&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 15:50:42 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/data-pattern-regex/m-p/247171#M70342</guid>
      <dc:creator>dnahuelnir</dc:creator>
      <dc:date>2019-01-23T15:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Data Pattern Regex</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/data-pattern-regex/m-p/247196#M70347</link>
      <description>&lt;P&gt;Looking at the "context sensitive help menu" for Data Filtering and regex this is how things should be formated (sorry the copy paste doesn't format well):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Syntax for Regular Expression Data Patterns&lt;/P&gt;&lt;P&gt;When creating a regular expression data pattern, the following general requirements apply:&lt;BR /&gt;•The pattern must have string of at least seven bytes to match. It can contain more than seven bytes but not fewer.&lt;BR /&gt;•The string match may or may not be case-sensitive, depending on which decoder you use. When you need case-sensitivity, define patterns for all possible strings to match all variations of a term. For example, to match any documents designated as confidential, you must create a pattern that includes “confidential”, “Confidential”, and “CONFIDENTIAL”.&lt;BR /&gt;The regular expression syntax in PAN-OS® is similar to traditional regular expression engines but every engine is unique. The following table describes the syntax supported in PAN-OS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pattern Rules Syntax Description&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;. Match any single character.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;? Match the preceding character or expression 0 or 1 time. The general expression MUST be inside a pair of parentheses.Example: (abc)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;* Match the preceding character or expression 0 or more times. The general expression MUST be inside a pair of parentheses. Example: (abc)*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;+ Match the preceding character or regular expression one or more times. The general expression MUST be inside a pair of parentheses.Example: (abc)+&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;|&amp;nbsp; &amp;nbsp;Equivalent to “or”.Example: ((bif)|(scr)|(exe)) matches “bif”, “scr” or “exe”.The alternative substrings must be in parentheses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-&amp;nbsp; &amp;nbsp;Used to create range expressions.Example: [c-z] matches any character between c and z, inclusive.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[ ]&amp;nbsp; &amp;nbsp;Match any.Example: [abz]: matches any of the characters a, b, or z.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;^&amp;nbsp; &amp;nbsp; &amp;nbsp;Match any except.Example: [^abz] matches any character except a, b, or z.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{ }&amp;nbsp; &amp;nbsp; Min/Max number of bytes.Example: {10-20} matches any string that is between 10 and 20 bytes. This must be directly in front of a fixed string, and only supports “-”.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;\&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;To perform a literal match on any one of the special characters above, it MUST be escaped by preceding them with a ‘\’ (backslash).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;amp;amp&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;amp; is a special character, so to look for the “&amp;amp;” in a string you must use “&amp;amp;amp” instead.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 17:58:00 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/data-pattern-regex/m-p/247196#M70347</guid>
      <dc:creator>Brandon_Wertz</dc:creator>
      <dc:date>2019-01-23T17:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Data Pattern Regex</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/data-pattern-regex/m-p/247219#M70354</link>
      <description>&lt;P&gt;The expression you've listed doesn't work the way you're intending.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;([518497|518472|518536]{6})([0-9]{10})&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The way a regex works when it comes to square brackets is a list, not a string. Every digit 1-9 is included in the three values you provided (highlighted in red below):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;[&lt;FONT color="#FF0000"&gt;518497&lt;/FONT&gt;|51847&lt;FONT color="#FF0000"&gt;2&lt;/FONT&gt;|51&lt;FONT color="#000000"&gt;8&lt;/FONT&gt;5&lt;FONT color="#FF0000"&gt;36&lt;/FONT&gt;]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the regex as it's written&amp;nbsp;above is essentially the same as:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;[1-9]{6}&lt;/FONT&gt;&lt;FONT color="#3366FF"&gt;[0-9]{10}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which is to say that it matches any of the following:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;111222&lt;/FONT&gt;&lt;FONT color="#3366FF"&gt;1234567890&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;999999&lt;/FONT&gt;&lt;FONT color="#3366FF"&gt;9999999999&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;537162&lt;/FONT&gt;&lt;FONT color="#3366FF"&gt;7591995601&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;FONT color="#000000"&gt;The regex to match what you want may be:&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;FONT color="#000000"&gt;518497|518472|518536[0-9]{16}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;That won't work on the firewall though&lt;/STRONG&gt;, it needs 7 non-token&amp;nbsp;characters to start the match, and the values you provided are only six characters. Additionally, you added "503441" to your first reply to &lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/5300"&gt;@Brandon_Wertz&lt;/a&gt;&amp;nbsp;so there may be more you're trying to match against.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you can put some of the actual strings you want to match it may help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 19:49:48 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/data-pattern-regex/m-p/247219#M70354</guid>
      <dc:creator>gwesson</dc:creator>
      <dc:date>2019-01-23T19:49:48Z</dc:date>
    </item>
  </channel>
</rss>

