title: Using Regular Expression to match fields with an arbitrary delimiter
body: <p>I suppose this should be an old question, however, I didn't find suitable solution in the forums after several hours searching.</p>
  
  <p>I'm using C# and I know the <code>Regex.Split</code> and <code>String.Split</code> methods can be used to achieve the expected results. For some reason, I need to use a regular expression to match the required fields by specifying an arbitrary delimiter. For example, here is the string:</p>
  
  <pre><code>#DIV#This#DIV#is#DIV#"A  "#DIV#string#DIV#
  </code></pre>
  
  <p>Here, <code>#DIV#</code> is the delimiter and is going to be split as:</p>
  
  <pre><code>This
  is
  "A  "
  string
  </code></pre>
  
  <p>How can I use a regular expression to match these values?</p>
  
  <p>By the way, the leading and trailing <code>#DIV#</code> could also be ignored, for example, below source string should also be same result with above:</p>
  
  <pre><code>#DIV#This#DIV#is#DIV#"A  "#DIV#string
  
  This#DIV#is#DIV#"A  "#DIV#string#DIV#
  
  This#DIV#is#DIV#"A  "#DIV#string
  </code></pre>