Hi all,

I have several strings of data, which are all very similar, however I
only wish to look at some strings which match a specific criteria and
ignore the rest. Some samples are below - I want the first and the last
string and to ignore the middle string.

/software/$$$PROTO.HIV/Microsoft/Windows NT/CurrentVersion

/software/CMI-CreateHive{199ADFC2-6E16-4946-BE90-5A3EC3A60902}/Wow6432Node/Microsoft/Office/12.0/User
Settings/Word_Core/Delete/Software/Microsoft/Windows NT/CurrentVersion

/software/CMI-CreateHive{199ADFC2-6E16-4946-BE90-5A3EC3A60902}/Microsoft/Windows
NT/CurrentVersion

I have constructed a regex to say capture any string starting with
/software/ and ending with /Microsoft/Windows NT/CurrentVersion, but
with only one string within slashes in the middle, see below:

\/software\/(.*?)\/Microsoft\/Windows NT\/CurrentVersion$

This regex captures everything because (.*?) takes everything. Any ideas
how I can achieve this? My brain is frying.

Many thanks
S

-- 
Posted via http://www.ruby-forum.com/.