Regular Expressions 101

C# Add default xml comment to public class properties

Open Workspace
  • PCRE2 (PHP)
  • Substitution
0

Regular Expression

/
^(?'line'public (?'type'\w+\??) (?'property'[A-z]+).*)$
/
gm

Description

Converts this: public string? PropertyA { get; set; }

To this: /// <summary> /// PropertyA /// </summary> public string? PropertyA { get; set; }

Submitted by Anonymous