<?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: Help with regex syntax in constraint in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/help-with-regex-syntax-in-constraint/m-p/1146421#M40682</link>
    <description>&lt;P&gt;Thanks Josh - It worked a treat&lt;/P&gt;&lt;P&gt;Love the&amp;nbsp;&lt;A href="https://regex101.com/" target="_blank" rel="noopener nofollow noreferrer"&gt;Regex 101&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;resource, I will pass it to other users&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;David Tipping&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Feb 2022 12:14:38 GMT</pubDate>
    <dc:creator>DavidTipping-Jsy</dc:creator>
    <dc:date>2022-02-22T12:14:38Z</dc:date>
    <item>
      <title>Help with regex syntax in constraint</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/help-with-regex-syntax-in-constraint/m-p/1146127#M40666</link>
      <description>&lt;P&gt;Hi - I'm trying to come up with a constraint using the regex function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to restrict field input to fit with a simple alphanumeric 1km grid with letters columns from A to R along the top and numbered rows of 1 to 11.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The constraint format is a capital letter between A and R followed by a 2 digit number between 01 and 11, so that A01 and&amp;nbsp; R11 pass but A2 or A12 or a2 or S11 all fail.&lt;/P&gt;&lt;P&gt;I have tried many combinations but not found a workable solution.&amp;nbsp;&lt;/P&gt;&lt;P&gt;regex (., '^[A-R]{1}[01-11]{2}$') passes the test in Survey123 connect but doesn't work when published.&amp;nbsp;regex (., '^[A-R]{1}\d[01-11]{2}$') fails&lt;/P&gt;&lt;P&gt;Any thoughts - should this be done through an input mask instead?&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;David Tipping&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Feb 2022 13:57:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/help-with-regex-syntax-in-constraint/m-p/1146127#M40666</guid>
      <dc:creator>DavidTipping-Jsy</dc:creator>
      <dc:date>2022-02-21T13:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex syntax in constraint</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/help-with-regex-syntax-in-constraint/m-p/1146168#M40670</link>
      <description>&lt;P&gt;&lt;A href="https://regex101.com/" target="_blank" rel="noopener"&gt;Regex 101&lt;/A&gt; is a great resource for writing and testing regex.&lt;/P&gt;&lt;P&gt;I notice one issue with your expression, which is the "[01-11]" bit. Regex 101 gives the explanation:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;Match a single character present in the list below&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;01&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;11&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN&gt;matches the character &lt;SPAN class=""&gt;0&lt;/SPAN&gt; with index &lt;SPAN class=""&gt;4810&lt;/SPAN&gt; (&lt;SPAN class=""&gt;3016&lt;/SPAN&gt; or &lt;SPAN class=""&gt;608&lt;/SPAN&gt;) literally (case sensitive)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;1-1&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN&gt;matches a single character in the range between &lt;SPAN class=""&gt;1&lt;/SPAN&gt; &lt;SPAN class=""&gt;(index 49)&lt;/SPAN&gt; and &lt;SPAN class=""&gt;1&lt;/SPAN&gt; &lt;SPAN class=""&gt;(index 49)&lt;/SPAN&gt; (case sensitive)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN&gt;matches the character &lt;SPAN class=""&gt;1&lt;/SPAN&gt; with index &lt;SPAN class=""&gt;4910&lt;/SPAN&gt; (&lt;SPAN class=""&gt;3116&lt;/SPAN&gt; or &lt;SPAN class=""&gt;618&lt;/SPAN&gt;) literally (case sensitive&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;DIV class=""&gt;&lt;P&gt;To match the numbers 0 - 11 with a padded zero, we can write "(0[1-9]|1[01])". This will match a 0 followed by anything from 1 to 9, or a 1 followed by a 0 or a 1.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Secondly, there's really no need to have the {1}, as regex will by default only match your bracketed range of characters once. So the full expression would be&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;[A-R](0[1-9]|1[01])&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;You can see that those other cases all fail to match:&lt;/P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jcarlson_0-1645456189712.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/34527i3C7D6FF1DF588F08/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jcarlson_0-1645456189712.png" alt="jcarlson_0-1645456189712.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 21 Feb 2022 15:10:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/help-with-regex-syntax-in-constraint/m-p/1146168#M40670</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2022-02-21T15:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex syntax in constraint</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/help-with-regex-syntax-in-constraint/m-p/1146421#M40682</link>
      <description>&lt;P&gt;Thanks Josh - It worked a treat&lt;/P&gt;&lt;P&gt;Love the&amp;nbsp;&lt;A href="https://regex101.com/" target="_blank" rel="noopener nofollow noreferrer"&gt;Regex 101&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;resource, I will pass it to other users&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;David Tipping&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Feb 2022 12:14:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/help-with-regex-syntax-in-constraint/m-p/1146421#M40682</guid>
      <dc:creator>DavidTipping-Jsy</dc:creator>
      <dc:date>2022-02-22T12:14:38Z</dc:date>
    </item>
  </channel>
</rss>

