in reply to Extract middle string from a path using RegExp
use strict; use warnings; my $str = 'C:\fldr1\fld2\fldr3\fldr4\fldr5\test.txt@@\main\Msometest\t +est12.1x\1'; my ($str2) = $str =~ /(fldr3\\fldr4\\fldr5\\test.txt)/; print "str2 = $str2\n"; __END__ str2 = fldr3\fldr4\fldr5\test.txt
If so, please re-phrase your question in more generic terms.
Also, there is free documentation at: perlretut
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Extract middle string from a path using RegExp
by dani_cv (Acolyte) on Sep 06, 2008 at 01:41 UTC | |
by ikegami (Patriarch) on Sep 06, 2008 at 02:04 UTC | |
by shmem (Chancellor) on Sep 06, 2008 at 10:41 UTC |