in reply to special pattern reading

You can use a regular expression match.
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; my $string = '?!?!?!/pack/something/whatever.cacshdska'; my ($before, $after) = $string =~ /(...)\W.*something.*\.c(.*)/; say for $before, $after;

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: special pattern reading
by N0obieMonk (Novice) on Jan 13, 2016 at 10:28 UTC

    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.

      OK, I think I understand now. Or don't I?
      #!/usr/bin/perl use warnings; use strict; use feature qw{ say }; for my $string ( '?!?!?!/pack/something/whatever.cacshdska', '!2!ab!!!!/pack/something/whatever.cacshdska', ) { my ($before, $after) = $string =~ m{(.*)..\W/.*\.c(.*)}; say "$before | $after"; }
      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

        that's it :D thank you a lot