daily pastebin goal
9%
SHARE
TWEET

Untitled

a guest Mar 15th, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Perl
  2. {
  3.     string _name;
  4.     public string Name { get; set; }
  5.     public Perl()
  6.     {
  7.     // Assign this._name
  8.     this._name = "Perl";
  9.     // Assign _name
  10.     _name = "Sam";
  11.  
  12.     // The two forms reference the same field.
  13.     Console.WriteLine(this._name);
  14.     Console.WriteLine(_name);
  15.     }
  16.     public static string doSomething(string test)
  17.     {
  18.         bla test;
  19.     }
  20. }
  21.    
  22. (?:public|private|protected)([sw]*)s+(w+)s*(s*(?:w+s+(w+)s*,?s*)+)
  23.    
  24. (?:publics|privates|protecteds|internals)?[sw]*s+(?<methodName>w+)s*(s*(?:(refs|/ins|outs)?s*(?<parameterType>w+)s+(?<parameter>w+)s*,?s*)+)
  25.    
  26. (?:publics|privates|protecteds)s*(?:readonlys+)?(?<type>w+)s+(?<name>w+)
  27.    
  28. var inputString0 = "public void test(string name, out int value)rnvoid test(string name, int value)";
  29. foreach (Match match in Regex.Matches(inputString0, @"(?:publics|privates|protecteds)?[sw]*s+(?<methodName>w+)s*(s*(?:(refs|/ins|outs)?s*(?<parameterType>[w?[]]+)s+(?<parameter>w+)s*,?s*)+)"))
  30. {
  31.     var methodName = match.Groups["methodName"].Value;
  32.     var typeParameterPair = new Dictionary<string, string>();
  33.     int i = 0;
  34.     foreach (var capture in match.Groups["parameterType"].Captures)
  35.     {
  36.         typeParameterPair.Add(match.Groups["parameterType"].Captures[i].Value, match.Groups["parameter"].Captures[i].Value);
  37.         i++;
  38.     }
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top