Regular Expressions   «Prev  Next»

Perl split function - Exercise

Use the split function


Objective:Given the following set of data, write a Perl program that uses the split function to get just the browser name and version.

The data


IBM-WebExplorer-DLL/v1.1e via Squid Cache version 1.0.5
IBM-WebExplorer-DLL/v1.1e via Squid Cache version 1.0.5
Lynx 2.5  libwww-FM/2.14
Lynx/2.6  libwww-FM/2.14
Mozilla/1.2N (Windows; I; 16bit)
Mozilla/2.0 (Win95; I)
Mozilla/2.0 (WinNT; I)
Mozilla/3.0 (Macintosh; I; PPC)
Mozilla/3.0 (Macintosh; U; PPC)
Mozilla/3.0 (X11; I; HP-UX B.10.10 9000/755)
Mozilla/3.01 (X11; I; Linux 2.0.27 i586)
Mozilla/3.01Gold (X11; I; FreeBSD 2.1.7-RELEASE i386)
Mozilla/4.0 (compatible; MSIE 4.0b1; Windows NT)
Mozilla/4.0b3 [en] (WinNT; I)  
Mozilla/4.0b3C (X11; I; SunOS 5.5 sun4u)
 


Paste your code in the text area below. Click the Submit button when you are finished.