in reply to Re: special pattern reading
in thread special pattern reading
your version reads the first "3" characters and everything after ".c" I need to read everything until the 3rd special character before the "/"
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; my $string = '!2!ab!!!!/pack/something/whatever.cacshdska'; my ($before, $after) = $string =~ /(...)\W.*something.*\.c(.*)/; say for $before, $after;
Output is "!2!acshdska" while I need output to be "!2!ab!acshdska" sorry if I wasn't clear enough ...my bad.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: special pattern reading
by choroba (Cardinal) on Jan 13, 2016 at 11:58 UTC | |
by N0obieMonk (Novice) on Jan 13, 2016 at 12:42 UTC |