I am writing a VSIX extension for Visual Studio. With this plugin, the user can select a class file from his decision browser in VS (so that the actual file is .cssomewhere on the disk), and then perform a specific action on this file by calling my VSIX code through the context menu item.
My expand VSIX need to know which properties publicand internalbelong to the selected file type.
I am trying to solve this using a regex, but I'm kind of stuck in it. I can’t figure out how to get class property names. He is finding too much now.
This is the regex that I still have:
\s*(?:(?:public|internal)\s+)?(?:static\s+)?(?:readonly\s+)?(\w+)\s+(\w+)\s*[^(]
Demo: https://regex101.com/r/ngM5l7/1
From this demo I want to extract all property names, so:
Brand,
YearModel,
HasRented,
SomeDateTime,
Amount,
Name,
Address
PS. I know that regex is not suitable for this kind of work. But I think I have no other VSIX extension options.
source
share