in reply to Re^9: Recursive search
in thread Recursive search

see Using character classes

 if ($line =~ /\/$([\.\w]+\.plf)/)
poj

Replies are listed 'Best First'.
Re^11: Recursive search
by perl_mystery (Beadle) on Dec 17, 2010 at 22:51 UTC

    I actually dont want to use \w ,would it be possible for you to suggest soemthing generic ,meaning ,whatever is present betwen the last "/" and .plf should match including the .plf

    INPUT: //tools/scripts/script_rev1.1.plf //tools/scripts/fil&es_data.plf

    OUTPUT: script_rev1.1.plf fil&es_data.plf

      You nearly had it right before with .+, try this

      if ($line =~ /\/(.+\.plf$)/)
      poj

      As file names can contain anything but a slash, match anything but a slash - i.e. [^/]+ - between the last directory separator and .plf:

      if ($line =~ m|/([^/]+\.plf$)|) {

        doesn't seem to work with $ at the end