title: SVG to geo coordinates from PHP regex pattern to C# pattern
body: <p>I want to try the SVG to geo converter from:</p>
  
  <p><a href="http://www.stoimen.com/blog/2011/02/11/from-svg-to-geo-coordinates-a-complete-guide/" rel="nofollow">http://www.stoimen.com/blog/2011/02/11/from-svg-to-geo-coordinates-a-complete-guide/</a></p>
  
  <p>The issue is that I am not used with PHP regular expressions:</p>
  
  <pre><code>preg_match('/(-?\d{1,2}\.?\d{0,3}),?(-?\d{1,2}\.?\d{0,3}),?(-?\d{1,2}\.?\d{0,3}),?(-?\d{1,2}\.?\d{0,3}),?(-?\d{1,2}\.?\d{0,3}),?(-?\d{1,2}\.?\d{0,3}),?/', $s, $m);
  </code></pre>
  
  <p>I would like to convert it to C# like:</p>
  
  <pre><code>public void Convert(string path)
      {
          if (path == null)
              path = defaultpath.Replace("\r\n","");
  
          var matches = path.Split('c');
  
          var pattern= @"/(-?\d{1,2}\.?\d{0,3}),?(-?\d{1,2}\.?\d{0,3}),?(-?\d{1,2}\.?\d{0,3}),?(-?\d{1,2}\.?\d{0,3}),?(-?\d{1,2}\.?\d{0,3}),?(-?\d{1,2}\.?\d{0,3}),?/";
          Regex r = new Regex(pattern, RegexOptions.IgnoreCase);
  
          foreach (var match in matches)
          {
              var result = r.Match(match); //always empty
          }
  
           //...
      }
  </code></pre>
  
  <p>But no idea what I have to modify in the pattern to make it work?</p>
  
  <p>Thanks, I will post an example with some conversions from Inkscape as soon I be able to use this snippet.</p>
  
  <p><strong>UPDATE</strong>
  After removing the slashes the result is always empty, here is part of the match array:</p>
  
  <p>"-0.86-0.27-3.816,0.199-4.002-1.055"
  "-0.049-0.328-1.109-1.799-1.512-1.824"
  "-0.647-0.04-5.182,1.896-5.219,2.013"
  "-0.051,0.161,0.928,0.627,0.319,0.832"
  "-0.028-0.003-0.716-0.36-0.816-0.334"
  "-0.13,0.034-0.262,0.834-0.363,0.771"
  "-0.176-0.24-0.179-0.48-0.007-0.719"
  "-0.986-0.764-0.345,0.764-0.526,0.764"
  "-0.771,0,0.184-0.849-0.675,0.037"
  "-2.13-0.433-2.267-0.756-4.129-2.754"
  "-1.329-1.42,0.383-8.158-1.571-8.535"
  "-2.223-3.153-6.413-3.037-8.806-5.037"</p>