re = /^\[assembly: AssemblyInformationalVersion\(\"(?P<version>[0-9]+(\.([0-9]+|\*)){1,3})\"\)\].*$/m
str = 'using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MRC+")]
[assembly: AssemblyDescription("MRC+ Configuration")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Kongsberg Seatex AS")]
[assembly: AssemblyProduct("MRC+")]
[assembly: AssemblyCopyright("Copyright © Kongsberg Seatex AS 2009 - 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("fd48eeca-4024-4955-aae1-e2279d13d262")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the \'*\' as shown below:
// [assembly: AssemblyVersion("5.6.*")]
[assembly: AssemblyVersion("5.7.*")]
[assembly: AssemblyFileVersion("5.7.1")]
[assembly: AssemblyInformationalVersion("5.7.1.7")] //Hurra!
[assembly: NeutralResourcesLanguage("en")]
'
# Print the match result
str.match(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html