in reply to Re^2: perl pattern match for end of string using STDIN and chomp
in thread perl pattern match for end of string using STDIN and chomp
#!/usr/bin/perl print "get some string: "; $dropped = chop($string = <STDIN>); print ord $dropped, " ", ord $/, "\n"; #$string = $ARGV[0]; #chomp($string); $string =~ m/\/([[:alnum:]]+)_.*\.(.+)$/; print "$1\n"; $type = $2; print "$type\n"; $string =~ m/(.+)\.${type}$/; #$string =~ m/(.+)\.${type}\Z/; #$string =~ m/(.+)\.${type}\z/; #$string =~ m/(.+)\.${type}/; print "$1\n"; exit 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: perl pattern match for end of string using STDIN and chomp
by cbolcato (Novice) on Oct 08, 2009 at 19:31 UTC |