title: How to check if variable has syntax and how to split this into a array?
body: <p>I have the following string &quot;L{id_extern}S{LocationId}&quot; from a field of my database.</p>
  <p>This string is the accepted syntax of a input field.</p>
  <p>In this example only Inputs should accepts which meets &quot;<strong>L</strong>something<strong>S</strong>something&quot;</p>
  <p>For Example</p>
  <pre><code>&lt;input name=&quot;myinput&quot; value=&quot;12345&quot;&gt; - is not correct
  &lt;input name=&quot;myinput&quot; value=&quot;L12345&quot;&gt; - is not correct
  &lt;input name=&quot;myinput&quot; value=&quot;L123S45&quot;&gt; - is correct
  </code></pre>
  <p>I have to compare the value (12345) with the syntax string.</p>
  <p>The part between the &quot;{...}&quot; could have unlimited (1 is min required) numbers and letters.</p>
  <p>At first I need to split the syntax-String and make it available in a multidimensional array for example</p>
  <pre><code>$myArray['placeholder1']=id_extern;
  $myArray['placeholder2']=LocationId;
  </code></pre>
  <p><strong>How I can split the string into a kind of this array?</strong></p>
  <p><strong>How I can compare the value of my Input field with my wanted syntax L{id_extern}S{LocationId} ?</strong> I think pregmatch could help, but I have no idea how it could work.</p>