Re: lug-bg: regular expresion ?
- Subject: Re: lug-bg: regular expresion ?
- From: boukov@xxxxxxxxxxx (Petko Boukov)
- Date: Mon, 20 Mar 2000 18:19:32 -0800
A ako iskash da si napravish spisyk ot direktoriite, v kojto file-yt e poslednijat element, mozhesh da probvash tova (zapisano vyv file i chmod u+x):
#! /usr/bin/perl -w
use strict;
my $whole_path = "/path/to/file/filename.zip";
my @pieces = split (/\//, $whole_path);
foreach my $elem (@pieces) {
print $elem, "\n";
}
Opisanie na split funkcijata shte poluchish s
$ perldoc perlfunc
Za da si slepish obratno pytekata, vizh join pak tam.
Petko
--
On Mon, 20 Mar 2000 18:41:34 Pavel Cholakov wrote:
>On Sat, Mar 18, 2000 at 08:57:30PM +0200, ice wrote:
>]
>] hi ,
>] imam sledniq elementaren problem . V edin perl script imam promenliva sys
>] sydyrjanie "/path/to/file/filename.zip" i iskam da otdelq samo pytq t.e.
>] "/path/to/file/" , i po vyzmojnost v regex da ne se polzva imeto na file-to shto
>] ako ima "+( )[ ]" vyv filename gyrmi . Ostanaloto "filename.zip" si go otdelih
>] ama tova s pytq me tormozi ot dva dni ... (Znam che iz RTM-to go pishe ama veche
>] vtori den ne go otkrivam ...) , 10x predvaritelno ...
>
>/(.*)\/[A-Za-z\.\ <...i drugite walidni simwoli za ime na fajl>]/ w $1 e pytq.
--== Sent via Deja.com http://www.deja.com/ ==--
Share what you know. Learn what you don't.
==================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers)
Otpiswaneto RABOTI !!! : Majordomo@xxxxxxxxxxxxxxxxxx UNSUBSCRIBE LUG-BG
http://www.linux-bulgaria.org/ Hosted by Internet Group Ltd. - Stara Zagora
|