Thread regex von bis string (5 answers)
Opened by Martin at 2013-10-07 15:47

FIFO
 2013-10-07 15:58
#171042 #171042
User since
2005-06-01
469 Artikel
BenutzerIn

user image
Naja, wenn nach dem konstanten 'book' nicht noch eins kommt:

Code (perl): (dl )
1
2
3
4
5
my $string = "/opt/pmg/ptt/book1_test";
my $path_incl_book;
if ( $string =~ / (.* book) /x ) {
    $path_incl_book = $1;
}
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? -- Brian Kernighan: "The Elements of Programming Style"

View full thread regex von bis string