Thread String rausfiltern (13 answers)
Opened by theresa at 2008-06-16 23:33

renee
 2008-06-17 11:52
#111134 #111134
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/perl

use strict;
use warnings;

my $string1 = '/pfad/bla/s132424328x/umleitung/datei';
my ($s) = $string1 =~ m!(s1[^/]+)!;
print "1: $s\n";

my $string2 = 'pfad/bla/etwas';
my ($pfad) = $string2 =~ m!^.*?/(.*)!;
print "2: $pfad\n";

__END__
C:\Perl>theresa.pl
1: s132424328x
2: bla/etwas
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread String rausfiltern