Candidate of Regex that matches Fully Qualified Names

With the help of Juanmi, and after a few polishing, it works!

(?:([\.\D]+\,\s*){1,2}(?i)Version\=(\d+\.){3}\d+\,\s*(?i)Culture\=[\w\-]+\,\s*(?i)PublicKeyToken\=[\w]{16})

For instance, the following qualified names will be matched:

System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.data, version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
myTypes, Version=1.0.1234.0, Culture=en-US, PublicKeyToken=b77a5c561934e089c

For sure, there will be a lot of cases when the Regex will match incorrectly, but I think it covers most of cases 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s