title: Regex to match property types C#
body: <p>I have a program where I have to check if any automatic property types matches a class name.</p>
  
  <p>So, for example, if I have:</p>
  
  <pre><code>public class User 
  {
     //Some code here
  }
  
  
  public class Cars
  {
    public string Brand {get; set;}
    public string YearModel {get; set;}
    public List&lt;User&gt; HasRented {get; set;}
  }
  </code></pre>
  
  <p>Now, I already have the code to match class names, so I can get the name "User" from "public class User". Problem is, I need the regex to get "<code>List&lt;User&gt;</code>" from "<code>public List&lt;User&gt; HasRented {get; set;}</code>". Of course, I want to get all the property types. So I also want the two "string" to match on the regex.</p>
  
  <p>If it is to any help, I've already got a regex that gets the Name of properties, so maybe someone could help me modify it to get the type of properties instead?</p>
  
  <p><strong>REGEX:</strong> \w+(?=\s*{\s*get\b)</p>
  
  <p><strong>EDIT:</strong> Forgot to mention that I have the source as a string, which is why I would like to match it with regex. To be extra clear: The ONLY thing that I need help with is the regex to get property types from a text that contains a class filled with automatic properties. Not the matching with the class name. </p>